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.

Start of changeThe Input-Output section cannot be specified in a function prototype definition.End of change

Start of change Program input-output section End of change
Start of changeThe same rules apply to program, method, and user-defined function I-O sections.End of change
Class input-output section
The input-output section is not valid for class definitions.
Method input-output section
Start of changeThe same rules apply to program, method, and user defined function I-O sections.End of change
Start of change User-defined function input-output section End of change
Start of changeStart of changeThe same rules apply to program, method, and user-defined function I-O sections.End of changeEnd of change

Format: input-output section

Read syntax diagramSkip visual syntax diagramINPUT-OUTPUT SECTION. FILE-CONTROL.file-control-paragraphI-O-CONTROL.i-o-control-paragraph.
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.