COBOL Manual for TNS and TNS/R Programs
Environment Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
6-61
I-O-CONTROL Paragraph
More than one SAME clause can be included in a program; however, there are some
restrictions on the usage of SAME clauses:
•
A file name must not appear in more than one SAME AREA clause or in more than
one SAME RECORD AREA clause.
•
If any file names of a SAME AREA clause appear in a SAME RECORD AREA
clause, all of the file names in that SAME AREA clause must appear in the SAME
RECORD AREA clause; however, additional file names not appearing in that
SAME AREA clause can also appear in that SAME RECORD AREA clause. The
rule that only one of the files mentioned in a SAME AREA clause can be open at
any given time takes precedence over the rule that all files mentioned in a SAME
RECORD AREA clause can be open at any given time.
The files mentioned in the SAME AREA or SAME RECORD AREA clause can differ in
organization or access.
SAME AREA Clause for Sort-Merge Files
The SAME AREA clause of the I-O-CONTROL paragraph can also specify sort-merge
files. HP COBOL ignores the advice provided to the compiler by the SAME AREA
clause. The file system automatically allocates and manages all memory areas needed
for file processing and for sort or merge operations.
RECORD
specifies that two or more files are to use the same memory area for processing
the current logical record.
SORT
is ignored by the compiler, but SORT specifies that the compiler can use (and re-
use) the same memory area to sort or merge each sort or merge file specified by
same-file. If SORT is specified, at least one same-file must be a sort file.
MERGE
is equivalent to SORT in the SAME AREA clause. If MERGE is specified, at least
one same-file must be a merge file.
AREA
RECORD
FOR
SAME
same-file
MERGE
SORT
VST060.vsd