COBOL Manual for TNS and TNS/R Programs

Data Fundamentals
HP COBOL Manual for TNS and TNS/R Programs522555-006
4-17
Records
These extra bytes are not part of the data item. If a data structure contains two items
separated by implicit FILLER bytes, then these bytes are a part of that data structure;
however, a data structure always begins with the first character position of its first
elementary item, ignoring any FILLER bytes that were generated to align that item
properly. The initial character positions of a data structure are never implicit FILLER
bytes.
Topics:
Records
Tables
REDEFINES Clause
Records
When a record contains implicit FILLER bytes, their character positions are included in
the record’s allocation requirements, and they occupy space in external
representations of the record.
Tables
When an elementary data item is described with an OCCURS clause, is subordinate to
a data structure described with an OCCURS clause, or both, all occurrences of the
data item must be aligned uniformly:
1. The first occurrence of the item is aligned to the required storage boundary. If the
elementary item also begins a containing table’s first occurrence, that table’s first
occurrence is defined to begin at the first character position of the item.
2. When the aligned item is itself a table, the first occurrence ends on the appropriate
storage boundary and the remaining occurrences follow without additional FILLER
bytes.
3. When the aligned item (or table of aligned items) belongs to a higher-level table,
further adjustment can be necessary.
If the elementary item is 2-byte-aligned and the containing group occurrence
consists of an odd number of character positions, the compiler inserts one byte of
FILLER after each group occurrence.
The preceding steps are repeated for each higher-level table.
FILLER bytes are not part of the containing occurrences themselves, but are included
in data structures that contain the complete table.