COBOL Manual for TNS and TNS/R Programs

Data Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
7-47
General Considerations
°
Relationship with File Description Entries
In the File Section, data description entries that describe records follow file
description entries or sort-merge file description entries.
The file description or sort-merge file description entry is not part of the data
description entry (see Example 7-8).
The record description entry defines a record area associated with the file named in
the file description entry.
In the other sections of the Data Division, record description entries are data
declarations, as in Example 7-9. The level-77 entry is a description of a data item that
is not part of a record. See Descriptions of Noncontiguous Elementary Items (Level
77).
Note. Any File Section record you describe cannot exceed 32,767 bytes. At execution time,
records for $RECEIVE files cannot exceed 32 KB (see RECEIVE-CONTROL Paragraph). For
input and output operations on NonStop systems, the actual record-length limit for individual
devices depends on the operating system limits.
Example 7-8. File Description Entry Followed by Record Description Entry
FD SAMPLE-FILE
LABEL RECORDS ARE OMITTED.
01 SAMPLE-RECORD.
05 STORE-ID.
10 STORE-NUMBER PIC 999.
10 STORE-REGION PIC X.
88 NORTHERN VALUE "N".
88 SOUTHERN VALUE "S".
05 STORE-MANAGER PIC X(35).
05 STORE-ADDRESS.
10 STREET PIC X(25).
10 CITY PIC X(15).
10 ZIP-CODE PIC 9(5).
Example 7-9. Record Description Entries as Data Declarations
01 MEDICATIONS.
03 BRAND-NAME PICTURE X(50).
03 SIZE-IN-MG PICTURE 9999V99.
03 CONTRA-COUNT PICTURE 99.
03 CONTRAINDICATIONS OCCURS 1 TO 25 TIMES
DEPENDING ON CONTRA-COUNT
PICTURE X(50).
77 I-DEX PICTURE 9999
USAGE IS COMPUTATIONAL
VALUE IS ZERO.