COBOL Manual for TNS and TNS/R Programs

Data Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
7-32
Data Description Entries
DATA RECORDS clause
data-name
is the name of a record that is declared following the sort-merge file description
entry. One or more fields of those records are used as keys in SORT and
MERGE statements.
Usage Consideration: Only the DATA RECORD and RECORD CONTAINS (or
RECORD VARYING) clauses are valid. For descriptions of these clauses, see File
Description Entries.
In Example 7-5, the record description entry associated with the sort-merge file
description entry defines CUSTOMER-NAME, CUSTOMER-ADDRESS, and
CUSTOMER-ZIP. These data items can be used as sort-merge keys.
Data Description Entries
Data description entries in the File Section describe record areas associated with files.
Each level-01 data description entry is a record description entry that describes the
record area for the file named in the preceding file description entry or sort-merge file
description entry. If multiple record description entries follow an file description or sort-
merge file description entry, each record description entry after the first one is a
redefinition of the record area. See Descriptions of Records (Levels 01-49).
You can use level-66 data description entries to rename contiguous items in a record
and level-88 data description entries to assign condition-names to values of record
items. See Descriptions That Rename Items (Level 66) and Descriptions of Condition-
Names for Values (Level 88). You cannot put level-77 data description entries in the
File Section.
Example 7-5. Sort-Merge File Description Entry
SD SORT-THIS
RECORD CONTAINS 80 CHARACTERS
DATA RECORD IS SORT-TEMPLATE.
01 SORT-TEMPLATE.
05 CUSTOMER-NAME PIC X(35).
05 FILLER PIC X(35).
05 CUSTOMER-ADDRESS PIC X(55).
05 CUSTOMER-ZIP PIC 9(15).
...
DATA
RECORDS
RECORD
IS
ARE
data-name
VST093.vsd