COBOL programs are divided into 4 divisions.
PROGRAM-ID. program name.
Identification Division does not contain any section.
– Describes the input and output formats used by the program.
– defines and describes storage for all data.
Sections in DATA DIVISION.
1. File Section – If we define any file in File Control of the Environment Division,
we have to describe it in FILE description of File Section.
2. Working Storage Section – We define and describe the data records within the
program which are not part of external files. This data can be initialized with
the value clause. Data entries in Working Storage section can be structuctured
Hierarchal based on the Level numbers.
Level numbers can be : 01 to 49, 66, 77, 88.
Data Types: Numeric , Alphabet, Alpha Numeric
REDEFINES Clause: Redefines Clause uses the same block of memory for more than one
Redefines must be done between the same level numbers.
Value clause can not be used with Redefines.
3. Linkage Section – Linkage Section is used to pass data to and from the program.
Procedure Division contains the instructions necessary for reading input processing
and producing the Output.
PROCEDURE DIVISION [USING DATA-NAME].