The I-O-CONTROL paragraph specifies input-output techniques to be used for the program's files.
General Format
I-O-CONTROL
[ APPLY {LOCK-HOLDING } ... ON {file} ... ] ...
{PRINT-CONTROL}
[ SAME [RECORD ] AREA FOR {file} ... ] ...
[SORT ]
[SORT-MERGE]
[ MULTIPLE FILE TAPE CONTAINS
{ tape-file [ POSITION pos ] } ... ] ... .
Syntax Rules
- file and tape-file name a file described by a SELECT clause in the FILE-CONTROL paragraph.
- A file name cannot appear in more than one SAME RECORD AREA clause.
- If file is a sort file, one of the RECORD, SORT, or SORT-MERGE options must be used in a SAME AREA clause.
- SORT and SORT-MERGE are equivalent.
- At least one file must be a sort file if the SORT or SORT-MERGE option is used.
- Pos must be an integer literal.
- You may put APPLY clauses of the IBM DOS/VS COBOL type into the I-O-CONTROL paragraph, but only when the compiler is in the
IBM DOS/VS COBOL compatibility mode. The clauses of the I-O-CONTROL paragraph may be arranged in any order, and the existing
APPLY clause may be used, regardless of the compiler mode. See IBM DOS/VS COBOL Conversions, in Transitioning to ACUCOBOL-GT for more information.
General Rules
- The APPLY clause modifies various characteristics of each file.
- If the PRINT-CONTROL option is specified, the named file must be a sequential file. This option causes the file to be treated as a print file. This has the same effect as specifying
"PRINT" in the file's ASSIGN clause.
- If the LOCK-HOLDING option is used, record locks on the file will not be automatically released by any I-O statement. Instead,
only the UNLOCK and CLOSE statements will release any record locks held on the file. This option has the same effect as the
LOCK ON MULTIPLE RECORDS phrase in the file's SELECT.
- The SAME AREA clause indicates that the compiler should share file information areas for the named files. ACUCOBOL-GT automatically
applies the most efficient use of memory possible for file information areas and treats this clause as commentary. In ICOBOL
compatibility mode, the SAME AREA clause is treated as a SAME RECORD AREA clause (see below).
- The SAME RECORD AREA clause indicates that the named files should share the same memory area for their current logical records.
- The SAME RECORD AREA clause is identical to an implicit redefinition of the shared files' record areas.
- The SAME SORT AREA clause indicates that the same memory should be used for each file. Because ACUCOBOL-GT dynamically allocates memory to sort files as needed and then discards the memory when finished, this
phrase is treated as commentary by the compiler.
- The MULTIPLE FILE TAPE clause is treated as commentary.