COBOL Manual for TNS and TNS/R Programs
Data Fundamentals
HP COBOL Manual for TNS and TNS/R Programs—522555-006
4-2
Data Structures
Data Structures
Data structures—records, files, and tables—are built from elementary items. Level-
numbers show the relationship of elementary data items to data structures.
Although the structural forms are defined within a hierarchy, independent structures of
any level are permitted. There is no requirement that all data be fully organized to the
highest level. Furthermore, multiple structures can refer to the same or overlapping
physical data.
Topics:
•
Level-Numbers
•
Records
•
Files
•
Tables
Level-Numbers
Level-numbers show the relationship of elementary data items to data structures.
A data structure includes all data items described after it and before the next item
whose level-number is less than or equal to the level-number of that data structure. In
Example 4-1, ADDRESS-RECORD includes everything before PERSONAL-RECORD,
OFFICE-NUMBER includes everything before OFFICE-ADDRESS, and so on.
All elementary or data structures immediately subordinate to a given data structure
must have identical level-numbers greater than that of the data structure. In
Example 4-1, OFFICE-NUMBER and OFFICE-ADDRESS are immediately subordinate
to ADDRESS-RECORD, DISTRICT and REGION are immediately subordinate to
OFFICE-NUMBER, and so on.
Level-Number Describes ...
01 through 49 A record (whose level-number starts at 01) and its subordinate data
items (whose level-numbers are higher, but not necessarily successive).
66 An elementary item or a data structure introduced by a RENAMES
clause. Use level-66 entries to regroup data structures.
77 An entry in the Working-Storage, Extended-Storage, or Linkage section
that describes noncontiguous elementary items. These items are not
subdivided and are not subdivisions of other items.
88 Condition-name entries, which define a conditional variable to be tested,
including a value or range of values assigned to that variable.