Open In App

COBOL Divisions

COBOL stands for Common Business-Oriented Programming Language, which is one of the oldest and first high-level programming languages. It is mostly used for the defense and insurance domains which require huge data processing.

Features of COBOL:

 

A COBOL program basically divided into the following four divisions:



  1. Identification division
  2. Environment division
  3. Data division
  4. Procedure division

Identification Division:

Syntax:

  IDENTIFICATION DIVISION.                                                                           



  PROGRAM-ID.  PGM-NAME.

  [AUTHOR.                               Comment Entry]

  [INSTALLATION.                     Comment Entry]

  [DATE-COMPILED.                  Comment Entry]

 [DATE-COMPILED.                  Comment Entry]

Environment division:

Syntax:

 ENVIRONMENT DIVISION.                                                 

 CONFIGURATION SECTION.

   INPUT-OUTPUT  SECTION.

   [FILE-CONTROL. ]

   [ File control entries ] 

   [ I – O  CONTROL. ]

  [ I- O  Control entries ]  

Data Division: 

Procedure Division: 

Example 1:




IDENTIFICATION DIVISION.
PROGRAM-ID. DIVISION-REPRESENTATION.
AUTHOR. RUPA KUMARI.
INSTALLATION. MF.
DATE-WRITTEN. 18 AUG 2022.
DATE-COMPILED. 18 AUG 2022.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. 
OBJECT-COMPUTER. 
INPUT-OUTPUT SECTION.
FILE-CONTROL
DATA DIVISION.
    WORKING-STORAGE SECTION.
    01 WS-VAR                 PIC X(50).
PROCEDURE DIVISION.
MAIN-PARA.
    DISPLAY 'ROW 1-6 COMES UNDER IDENTIFICATION DIVISION'.
    DISPLAY 'ROW 7-12 COMES UNDER ENVIRONMENT DIVISION'.
    DISPLAY 'ROW 13-15 COMES UNDER DATA DIVISION'.
    DISPLAY 'ROW AFTER 16 WILL COMES UNDER PROCEDURE DIVISION'.
STOP RUN.

Output:

 

Explanation:


Article Tags :