|
COBOL DATA DIVISION
DATA DIVISION
DATA DIVISION contains 3 important sections.
(1) FILE SECTION
(2) WORKING-STORAGE SECTION
(3) LINKAGE-SECTION
(1) FILE SECTION
For Every file used in the program, we should have a entry in this section.
Define the structure of the record of each file. We will explain about this
section more in COBOL-FILES chapter. Below picture gives us the relation
between FILE SECTION , FILE-CONTROL/INPUT-SECTION SECTION & JCL file entries.
(2) WORKING-STORAGE SECTION
All the data items used in the program should define in WORKING STORAGE SECTION
( If those fields not belong to FILE SECTION or LINKAGE SECTION )
(3) LINKAGE SECTION
When program designed to receive data from runJCL or calling programs,
appropriate data items need to be defined in this section. Thru the data items
defined in this section, program will get data from other programs/jobs. Below
picture shows how data passed to LINKAGE SECTION data items from other program.
Data in WS-NAME data-item in MAINPROG program will be passed to LK-NAME of
LINKAGE SECTION in COBOL1 program.
|
|