COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

Each file description entry must be followed by one or more record description entries. These
describe the format or formats of the logical records in the file. When more than one record
description entry appears, they can describe record images of different lengths and substructures.
All record description entries associated with a single file represent implicit redefinitions of the
file’s record area. The file name in the file description entry can be used as the final qualifier in
references to its record items, their subordinate data items, or condition-names associated with
any of these.
When more than one of the source programs compiled into a run unit includes a file description
entry defining the same external file name, all of these descriptions must specify the same block
size convention, character code convention, labeling convention, linage attributes, and record
attributes. For details, see EXTERNAL Clause.
The file description entry describes the logical characteristics of a data file.
The record description entries associated with a file description entry define the possible formats
of the logical records for that file. Although different record descriptions define different types of
logical records from the perspective of the source program, the corresponding logical records in
the file might not have different representations. Conceptually, every record description applies to
every logical record in the file; therefore, when the file actually contains different types of logical
records, it is your responsibility to code the program such that it determines which of the record
descriptions are appropriate for each particular record.
In Example 35, two record description entries (level-01 items) follow a file description entry.
Example 35 File Description (FD) Entry
FD INPUT-FILE-MASTER
GLOBAL
RECORD IS VARYING IN SIZE FROM 10 TO 256 CHARACTERS
01 OFFICE-DETAILS.
03 NUMBER PIC 9(5).
03 ADDRESS.
05 LINE-1 PIC X(25).
05 LINE-2 PIC X(25).
05 LINE-3 PIC X(25).
03 HEAD-COUNT PIC 999.
03 MANAGER-ID-NUMBER 9(5).
01 EMPLOYEE-DETAILS.
03 ID-NUMBER PIC 9(5).
03 TITLE PIC X(25).
03 MANAGER-ID-NUMBER PIC 9(5).
03 SALARY-LEVEL PIC X(2).
The syntax of a file description entry (file-description ) depends on the file’s access mode:
File Description Entry for Sequential File
File Description Entry for Line Sequential File (OSS environment only)
File Description Entry for Relative, Indexed, or Queue File
156 Data Division