I-O-Control Paragraph

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

  1. file and tape-file name a file described by a SELECT clause in the FILE-CONTROL paragraph.
  2. A file name cannot appear in more than one SAME RECORD AREA clause.
  3. If file is a sort file, one of the RECORD, SORT, or SORT-MERGE options must be used in a SAME AREA clause.
  4. SORT and SORT-MERGE are equivalent.
  5. At least one file must be a sort file if the SORT or SORT-MERGE option is used.
  6. Pos must be an integer literal.
  7. 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

  1. The APPLY clause modifies various characteristics of each file.
    1. 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.
    2. 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.
  2. 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).
  3. The SAME RECORD AREA clause indicates that the named files should share the same memory area for their current logical records.
  4. The SAME RECORD AREA clause is identical to an implicit redefinition of the shared files' record areas.
  5. 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.
  6. The MULTIPLE FILE TAPE clause is treated as commentary.