Friday, 12 December 2008

COBOL DIVISIONS

The IDENTIFICATION DIVISIION is the first division of every COBOL source program. There may be several paragraphs in this division of which the paragraph PROGRAM-ID is the essential in most of the machines. The other paragraphs are optional and may be used mainly for documentation purposes.

IDENTIFICATION DIVISION.

PROGRAM-ID. Entry.

[AUTHOR.] Entry.

[INSTALLATION.] Entry.

[DATE-WRITTEN.] Entry.

[DATE-COMPILED.] Entry.

[SECURITY.] Entry.

The following shows the structure of this division









The division heading and paragraph names should be coded as area A entries. Each of the paragraph names must end with a period followed by at least one blank space. The entries following the paragraph heading must be terminated by a period. The entry in the PROGRAM-ID paragraph contains the program name to be used to identify the object program. The program name can consist of 1 to 30 characters and must contain at least one letter.

The entries in the other paragraphs are normally treated as comments.

ENVIRONMENT DIVISION:

The ENVIRONMENT DIVISION is the division that must follow the IDENTIFICATION DIVISION in a COBOL source program. Among all the four division this one is the most machine-dependent division. The computer and all peripheral devices required by the program are described in this division.

This division contains two sections.

v CONFIGURATION SECTION

v INPUT-OUTPUT SECTION

The out-line of the sections and paragraphs of this division is shown below.

ENVIRONMENT DIVISION.

CONFIGURATION SECTION.

SOURCE-COMPUTER. Source-computer-entry.

OBJECT-COMPUTER. Object-computer-entry.

[SPECIAL NAMES. Special-name-entry].

[INPUT-OUTPUT SECTION.

FILE-CONTROL. {file-control-entry}…

[I-O CONTROL. Input-output-control-entry].]



No comments:

Post a Comment