Divisions in cobol

D

There are four Divisions in COBOL:

  1. IDENTIFICATION DIVISION
  2. ENVIRONMENT DIVISION
  3. DATA DIVISION.
  4. PROCEDURE DIVISION

 

Divisions description in Brief:-
  • IDENTIFICATION DIVISION

It is the first and only mandatory division of every COBOL program. The programmer and the compiler use this division to identify the program. In this division, PROGRAM-ID is the only mandatory paragraph. PROGRAM-ID specifies the program name that can consist 1 to 30 characters.

Example

IDENTIFICATION DIVISION.

PROGRAM-ID. HELLOCOBOL.

PROCEDURE DIVISION.

DISPLAY ‘Welcome to Coboltutorial‘.

STOP RUN.

Output-‘Welcome to Coboltutorial

 

  • ENVIRONMENT DIVISION

Environment division is used to specify input and output files to the program. This division is optional. It consists of two sections −

  1. Configuration section provides information about the system on which the program is written, compiled and executed. It consists of two paragraphs −

Source computer − System used to compile the program.

Object computer − System used to execute the program.

  1. Input-Output sectionprovides information about the files to be used in the program. It consists of two paragraphs −

File control − Provides information of external data files used in the program.

I-O control − Provides information of files used in the program.

Example:

ENVIRONMENT DIVISION.

CONFIGURATION SECTION.

SOURCE-COMPUTER. IBM-OS.

OBJECT-COMPUTER. IBM1-OS.

INPUT-OUTPUT SECTION.

FILE-CONTROL.

SELECT FILE1 ASSIGN TO PFFILE1

ORGANIZATION IS SEQUENTIAL/INDEXED/RELATIVE

ACCESS MODE IS SEQUENTIAL/RANDOM/DYNAMIC

KEY IS RECORD-KEY

FILE STATUS ID FS-1.

About the author

Add comment

By neelam

Find us

Address
Chennai ,Tamil Nadu,603103

Hours
Monday—Friday: 9:00AM–5:00PM
Saturday & Sunday: 11:00AM–3:00PM

About This Site

This site is to help the beginners in COBOL.

Categories