The environment division describes the environment for which
the program is written. It has two sections the
CONFIGURATION SECTION and the
INPUT-OUTPUT SECTION. The first of these is
optional, but you should always include one.
The configuration section describes the hardware on which the program is
to run and on which it is to be compiled. The source computer is the computer
on which the program is to be compiled. The object computer is the
one on which the program is to run.
Additional features of the CONFIGURATION SECTION are:
Here is what you need for the configuration section.
COBOL programs historically get their input from files
and write their output to files. Files
are thus part of the environment in which a COBOL program runs.
In addition most operating systems have naming conventions for
files that lead to names that are unacceptable to COBOL. The FILE-CONTROL
part of the INPUT-OUTPUT section serves to identify external files
by names that are acceptable to the COBOL compiler.
COBOL allows many kinds of files we only need sequential files and
sort files so that is all that is illustrated.
Note that input files must be declared line sequential if they are created with
an editor. This is because of the carriage return at the end of each line.
CONFIGURATION SECTION
INPUT-OUTPUT SECTION
Return to the cobol home page