Input-Output section
The input-output section of the ENVIRONMENT DIVISION contains FILE-CONTROL paragraph and I-O-CONTROL paragraph.
The exact contents of the input-output section depend on the file organization and access methods used. See ORGANIZATION clause and ACCESS MODE clause.
- Program input-output section
- The same rules apply to program and method I-O sections.
- Class input-output section
- The input-output section is not valid for class definitions.
- Method input-output section
- The same rules apply to program and method I-O sections.
- FILE-CONTROL
- The
keyword FILE-CONTROL identifies the file-control paragraph.
This keyword can appear only once, at the beginning of the FILE-CONTROL
paragraph. It must begin in Area A and be followed by a separator
period.
The keyword FILE-CONTROL and the period can be omitted if no file-control-paragraph is specified and there are no files defined in the program.
- file-control-paragraph
- Names
the files and associates them with the external data
sets.
Must begin in Area B with a SELECT clause. It must end with a separator period. See FILE-CONTROL paragraph.
file-control-paragraph can be omitted if there are no files defined in the program, even if the FILE-CONTROL keyword is specified.
- I-O-CONTROL
- The keyword I-O-CONTROL identifies the I-O-CONTROL paragraph.
- i-o-control-paragraph
- Specifies information needed for efficient transmission of data between the external data set and the COBOL program. The series of entries must end with a separator period. See I-O-CONTROL paragraph.