COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
The compiler aligns a data item according to its size if one of these conditions is true:
• The data item is described as USAGE BINARY or USAGE COMPUTATIONAL and the PORT
directive is not specified.
• The data item is described as USAGE NATIVE-n.
• The data item is described with a SYNCHRONIZED clause.
A data item that is aligned according to its size is usually aligned on a character position that is
divisible by 2. This is not a TNS/E word size, but this alignment preserves data compatibility.
If the PORT directive is specified, BINARY/COMPUTATIONAL data items are not aligned on byte
boundaries, and program execution can be much slower. The PORT directive does not affect
NATIVE-n data items; they are always aligned on byte boundaries.
If the PORT directive is not specified, then a data item is aligned on a 2-byte boundary unless it is
described with the SYNCHRONIZED clause. If it is described with the SYNCHRONIZED clause,
it is aligned on a 2-byte boundary if its size is less than 4 bytes, and on a 4-byte boundary if its
size is 4 bytes or larger.
Within a data structure, the compiler might align BINARY/COMPUTATIONAL data items by
inserting implicit FILLER bytes.
More information:
SourcesTopics
USAGE ClauseUSAGE clause
SYNCHRONIZED ClauseSYNCHRONIZED clause
PORT and NOPORTPORT directive
Implicit FILLER BytesImplicit filler bytes
Implicit FILLER Bytes
When an odd number of character positions precedes a 2-byte-aligned item within a record, the
compiler inserts FILLER bytes before the item, completing allocation of the preceding 2 bytes.
When the number of character positions preceding a 4-byte-aligned item within a record is not a
multiple of 4, the compiler inserts the number of FILLER bytes needed to complete allocation of the
preceding 4 bytes.
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.
88 Data Fundamentals










