COBOL/400 Language Help


Data Division

Description
The Data Division of a COBOL source program describes, in a structured manner, all the data to be processed by the object program. In a COBOL source program, the Data Division is optional.

The Data Division is divided into three sections. Each section has a specific logical function within a COBOL source program, and each may be omitted from the source program when that logical function is not needed. If you include these sections, they must be written in the order shown:

File Section
Describes externally stored data (including sort-merge files).

Working-Storage Section
Describes internal data.

Linkage Section
Describes data made available by another program.
->->--DATA DIVISION.------------------------------------------->
 
->-*--------------------------------------------------------*->
  +              *----------------------------------------*+
  +              V                                        ++
  *-FILE SECTION.*----------------------------------------**
                 +                                        +
                 *file-description-entry--item-1----------*
 
->-*-------------------------------------------------------*-->
  +                          *---------------------------*+
  +                          V                           ++
  *WORKING-STORAGE SECTION.--*---------------------------**
                             *record-description-entry---*
                             *data-item-description-entry*
 
->-*---------------------------------------------------*-----><-
  +                   *-----------------------------* +
  +                   V                             + +
  *-LINKAGE SECTION. -*-----------------------------*-*
                      *-record-description-entry----*
                      *-data-item-description-entry-*
 
where item-1 is:
 
         *------------------------*
         V                        +
->->-------record-description-entry-*--------><-


[ Top of Page | Previous Page | Next Page | Table of Contents ]