The I-O-Control Paragraph

The I-O-Control paragraph specifies the points at which rerun is to be established, the memory area which is to be shared by different files, and for files with sequential organization the location of files on a multiple file reel.

ANS85 The RERUN and MULTIPLE FILE TAPE clauses of the I-O-Control paragraph are classed as obsolete elements in the ANSI'85 standard and are scheduled to be deleted from the next full revision of the ANSI Standard.

MF All dialects within this COBOL implementation fully support this syntax. The FLAGSTD Compiler directive can be used to detect all occurrences of this syntax.

XOPEN Although they are a part of the standard COBOL definition, the RERUN and MULTIPLE FILE TAPE clauses are explicitly excluded from the X/Open COBOL language definitions and should not be used in a conforming X/Open COBOL source program.

General Format


Syntax for General Format for the
I-O-CONTROL paragraph

Syntax Rules

  1. The I-O-Control paragraph is optional.
  2. When either the integer-1 RECORDS clause or the integer-2 CLOCK-UNITS clause is specified, character-string must be given in the RERUN clause.
  3. In the SAME AREA clause, SORT and SORT-MERGE are equivalent.
  4. If the SAME SORT AREA or SAME SORT-MERGE AREA clause is used, at least one of the file-names must represent a sort or merge file. Files that do not represent sort or merge files can also be named in the clause.
  5. The two forms of the SAME clause (SAME AREA, SAME RECORD AREA) are considered separately in the following:

    More than one SAME clause can be included in a source element, subject to the following restrictions:

    1. A file-name must not appear in more than one SAME AREA clause.
    2. A file-name must not appear in more than one SAME RECORD AREA clause.
    3. If one or more 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 one time takes precedence over the rule that all files mentioned in a SAME RECORD AREA clause can be open at any one time.
    4. A file-name that represents a sort or merge file must not appear in a SAME AREA clause.
    5. A file-name that represents a sort or merge file must not appear in more than one SAME SORT AREA or SAME SORT-MERGE AREA clause.
    6. If a file-name that does not represent a sort or merge file appears in a SAME AREA clause and one or more SAME SORT AREA or SAME SORT-MERGE AREA clauses, all of the files named in that SAME AREA clause must be named in that SAME SORT AREA or SAME SORT-MERGE AREA clause(s).
  6. The files referenced in the SAME AREA, SAME SORT AREA, SAME SORT-MERGE AREA, or SAME RECORD AREA clause need not all have the same organization or access.
  7. MF Character-string must not be a reserved word, a literal or a user-name.
  8. The END OF REEL/UNIT clause can only be used if file-name-2 is a sequential file.
  9. More than one RERUN clause can be specified for a given file-name-2, subject to the following restrictions:
    1. When multiple integer-1 RECORD clauses are specified, no two of them can specify the same file-name-2.
    2. When multiple END OF REEL or END OF UNIT clauses are specified, no two of them can specify the same file-name-2.
  10. Only one RERUN clause containing the CLOCK-UNITS clause can be specified.
  11. OSVSVSC2 Each clause in the I-O-Control paragraph may optionally be followed by a period.

General Rules

  1. ANS85 The RERUN clause is documentary only.
  2. The SAME AREA clause specifies that two or more files that do not represent sort or merge files are to use the same memory area during processing. The area being shared includes all storage areas assigned to the files specified. It is not, therefore, valid to have more than one of the files open at the same time. (See Syntax Rule 5c.)
  3. The SAME RECORD AREA clause specifies that two or more files are to use the same memory area for processing the current logical record. All of the files can be open at the same time. A logical record in the SAME RECORD AREA is considered as a logical record of each opened output file whose file-name appears in this SAME RECORD AREA clause and of the most recently read input file whose file-name appears in this SAME RECORD AREA clause. This is equivalent to an implicit redefinition of the area; that is, records are aligned on the leftmost character position.
  4. MF The APPLY clause is documentary only.
  5. MF The MULTIPLE FILE clause is documentary only.
  6. If the SAME SORT AREA or SAME SORT-MERGE AREA clause is used, at least one of the file-names must represent a sort or merge file. Files that do not represent sort or merge files can also be named in the clause. This clause specifies that storage is shared as follows:
    1. The SAME SORT AREA or SAME SORT-MERGE AREA clause specifies a memory area which is made available for use in sorting or merging each sort or merge file named. Thus any memory area allocated for the sorting or merging of a sort or merge file is available for reuse in sorting or merging any of the other sort or merge files.
    2. In addition, storage areas assigned to files that do not represent sort or merge files can be allocated as needed for sorting or merging the sort or merge files named in the SAME SORT AREA or SAME SORT-MERGE AREA clause.
    3. Files other than sort or merge files do not share a storage area. If you wish these files to share a storage area, you must also include in the source element a SAME AREA or SAME RECORD AREA clause naming these files.
    4. During the execution of a SORT or MERGE statement that refers to a sort or merge file named in this clause, any non-sort-merge files named in this clause must not be open.