DATA DIVISION overview
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.
- Program data division
- The DATA DIVISION of a COBOL source program describes, in a structured manner, all the data to be processed by the program.
- Object data division
- The object data division contains data description entries for instance object data (instance data). Instance data is defined in the WORKING-STORAGE SECTION of the object paragraph of a class definition.
- Factory data division
- The factory data division contains data description entries for factory object data (factory data). Factory data is defined in the WORKING-STORAGE SECTION of the factory paragraph of a class definition.
- Method data division
- A method data division contains data description entries for data accessible within the method. A method data division can contain a LOCAL-STORAGE SECTION or a WORKING-STORAGE SECTION, or both. The term method data applies to both. Method data in LOCAL-STORAGE is dynamically allocated and initialized on each invocation of the method; method data in WORKING-STORAGE is static and persists across invocations of the method.