COBOL Environment Division

COBOL Identification Division COBOL Configuration Section

Advertisements


ENVIRONMENT DIVISION describes the computer and other devices used to compile, execute the program and the data files used in the program.

ENVIRONMENT DIVISION is optional.

The ENVIRONMENT DIVISION describes the environment to the system in which the program will run.

The ENVIRONMENT DIVISION describes the input and output sources required to run the program and to whom with the program interacting like printers, files etc.

ENIVIRONMENT DIVISION has two sections. i.e. The CONFIGURATION and INPUT-OUTPUT SECTIONs and those are optional.

ENIVIRONMENT DIVISION always supplies the system dependent information.

ENIVIRONMENT DIVISION has two sections


  1. CONFIGURATION SECTION
  2. INPUT-OUTPUT SECTION

Syntax:

ENVIRONMENT DIVISION. 
[Optional]	 [CONFIGURATION SECTION. 
[Optional]	 [SOURCE-COMPUTER. {source-computer-entry}]
[Optional]	 [OBJECT-COMPUTER. {object-computer-entry}]
[Optional]	 [SPECIAL-NAMES.   {special-names-entry}]]
				
[Optional]	 [INPUT-OUTPUT SECTION.
[Optional]	 [FILE-CONTROL.    {file-control-entry}]
[Optional]	 [I-O-CONTROL.     {i-o-control-entry}]]	

Environment Division Practical Example:


A simple program for ENVIRONMENT DIVISION with all entries


Code:



Output:



CONFIGURATION SECTION


CONFIGURATION SECTION describes about the hardware where the program needs to compile or needs to run.

All the entries in CONFIGURATION SECTION should code in AREA A.


Syntax:

[Optional]	 [CONFIGURATION SECTION. 
[Optional]	 [SOURCE-COMPUTER. {source-computer-entry}]
[Optional]	 [OBJECT-COMPUTER. {object-computer-entry}]
[Optional]	 [SPECIAL-NAMES.   {special-names-entry}]]

CONFIGURATION SECTION can be explained in detail here .


INPUT-OUTPUT SECTION.


INPUT-OUTPUT SECTION links the identifiers from the program to external program resources like files etc,.

INPUT-OUTPUT SECTION relates the file-names defined to the corresponding file-names known to the operating system.

INPUT-OUTPUT SECTION can be explained in detail here .


COBOL Identification Division COBOL Configuration Section

Advertisements