The Environment Division provides a standard method for describing those aspects of a data processing problem which depend on the physical characteristics of a given computer installation. This division can be used to define the equipment configuration of the data processing system on which the program is to be compiled and executed. It also provides an opportunity for specifying input/output control, specific machine characteristics, and control techniques.
The Environment Division must be included in a COBOL compilation unit.
It consists of two optional sections:
CONFIGURATION SECTION
INPUT-OUTPUT SECTION.
The CONFIGURATION SECTION deals with the characteristics of the computers used for compiling and executing the program (source computer and object computer, respectively).
This section is divided into the following paragraphs:
the SOURCE-COMPUTER paragraph, which describes the equipment configuration of the data processing system on which the compilation unit is to be compiled
the OBJECT-COMPUTER paragraph, which describes the equipment configuration of the data processing system on which the object program is to be executed
the SPECIAL-NAMES paragraph, which (among other things) relates the implementor-names used by the compiler to the mnemonic-names used in the compilation unit.
the REPOSITORY paragraph, which specifies the interfaces, classes and program prototype names used in programs.
The INPUT-OUTPUT SECTION deals with the required information for controlling the transmission of data between external devices and the object program.
This section is divided into two paragraphs:
the FILE-CONTROL paragraph, which names the files and assigns them to external devices
the I-O-CONTROL paragraph, which describes special control techniques to be used in the object program.
General format
ENVIRONMENT DIVISION.
[configuration-section]
[input-output-section]