This overview describes the structure of the data division for programs, object definitions, factory definitions, and methods. Each section in the data division has a specific logical function within a COBOL program, object definition, factory definition, or method and can be omitted when that logical function is not needed. If included, the sections must be written in the order shown. The data division is optional.
Format: program and method data division >>-DATA DIVISION.-----------------------------------------------> >--+-----------------------------------------------------------------------------+--> | .----------------------------------------------------------. | | V | | '-FILE SECTION.----+------------------------------------------------------+-+-' | .--------------------------. | | V | | '-file-description-entry----record-description-entry-+-' >--+---------------------------------------------------------------+--> | .---------------------------------. | | V | | '-WORKING-STORAGE SECTION.----+-----------------------------+-+-' +-record-description-entry----+ '-data-item-description-entry-' >--+-------------------------------------------------------------+--> | .---------------------------------. | | V | | '-LOCAL-STORAGE SECTION.----+-----------------------------+-+-' +-record-description-entry----+ '-data-item-description-entry-' >--+-------------------------------------------------------+--->< | .---------------------------------. | | V | | '-LINKAGE SECTION.----+-----------------------------+-+-' +-record-description-entry----+ '-data-item-description-entry-'
Format: object and factory data division >>-DATA DIVISION.-----------------------------------------------> >--+---------------------------------------------------------------+->< | .---------------------------------. | | V | | '-WORKING-STORAGE SECTION.----+-----------------------------+-+-' +-record-description-entry----+ '-data-item-description-entry-'