Dec 09

The Environment Division describes the environment for which the program is written. It also specifies input-output control and describes special control techniques and hardware characteristics. The Environment Division follows the Identification Division. The general format defines the order of appearance of Environment Division entries. A contained program cannot include a configuration section.

The purpose of the Environment Division is to isolate in one place all aspects of the program that are dependant upon a specific computer, device or encoding sequence.

The idea behind this is to make it easy to change the program when it has to run on a different computer or one with different peripheral devices.

In the Environment Division, aliases are assigned to external devices, files or command sequences. Other environment details, such as the collating sequence, the currency symbol and the decimal point symbol may also be defined here. The Environment Division has two sections:

  • The CONFIGURATION SECTION

The CONFIGURATION SECTION describes the hardware on which the programs 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:

1. SPECIAL-NAMES

This is used to define mnemonics for printer control.

2. SOURCE-NAMES

Specifies the computer on which the source program is to be compiled.

3. OBJECT-COMPUTER

Describes the computer on which the program is to execute.

  • The INPUT-OUTPUT 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.

Incoming search terms for the article:

cobol contained program

Leave a Reply

Features Stats Integration Plugin developed by YD