Data Division Structure COBOL

The five subordinate sections in the Data Division are as follows:

  1. The File Section, which defines the structure of data files. Each file is defined by a file description entry and one or more record descriptions. Record descriptions are written immediately following the file description entry.
  2. The Working-Storage Section, which describes records and noncontiguous data items which are not part of external data files but are developed and processed internally. It also describes data items whose values, assigned in the source program, do not change during execution of the object program.
  3. The Linkage Section, which describes formal arguments to be associated with actual arguments passed in the USING or GIVING phrases of a CALL statement and records to be based on a pointer value by use of the SET statement.

    No space is allocated in the program for data items defined in the Linkage Section of that program.Procedure Division references to these data items are resolved at runtime by replacing the reference in the program with the location assigned by the calling program for a formal argument associated with an actual argument or the location assigned by the most recently executed SET statement that established the base address for a based linkage record. In the case of index-names, no such correspondence is established. Index-names in the called and calling program always refer to separate indexes for indexes defined in the Linkage Section.

    Data items defined in the Linkage Section of a program may be referenced within the Procedure Division of that program only if they are specified as operands of the USING or GIVING phrases of the Procedure Division header, or are subordinate to such operands,and the object program is under the control of a CALL statement that specifies a USING or GIVING phrase that includes a corresponding actual argument to associate with the formal argument, or the SET statement has been used to associate an address with the linkage record. An exception to this rule is that the ADDRESS OF special register may reference the record-name and will return NULL if the reference requirements have not been satisfied.

  4. The Communication Section, which describes the data items that serve as the interface between the Message Control System (MCS)and the program.
  5. The Screen Section, which describes the layout and attributes of fields on a terminal screen. It also provides for the automatic transfer of data between screen fields and data items defined in the other sections of the Data Division.

Data Division Structure

Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

COBOL Topics