COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

of 8-bit bytes aligned on byte or 2-byte boundaries, whether or not they are described with
the SYNCHRONIZED clause.
COMPUTATIONAL or BINARY Data Items
If the program is not compiled with the PORT directive, 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.
If the program is compiled with the PORT directive, and the COMPUTATIONAL or BINARY
data item is not described with the SYNCHRONIZED clause, it is byte-aligned.
JUSTIFIED Clause
The JUSTIFIED clause causes nonstandard positioning of data within a receiving item. It can appear
only in the data description of an elementary item that meets these criteria:
Its category is alphabetic or alphanumeric.
It is not subordinate to any data structure that has associated condition-names.
It is not subordinate to any data structure that is described with a VALUE clause.
When a receiving data item is described with the JUSTIFIED clause, the standard alignment rules
do not apply. Instead, a sending item too big for the receiving item is truncated on the left. If the
sending item is smaller, its rightmost character is aligned with the rightmost character of the receiving
field and the value is extended to the left with space characters.
Usage Considerations:
Effect of RIGHT on Compilation
The optional keyword RIGHT has no effect on the compilation, and serves only to provide
emphasis.
Trailing Spaces Are Not Ignored
Trailing spaces in a data item are not ignored when the data item is moved to a right-justified
field. For example,
77 F1 PIC X(3) JUSTIFIED RIGHT.
77 F2 PIC X(2) VALUE "A".
MOVE F2 TO F1.
gives F1 the value
" A "
not the value
" A"
NOTE: The JUSTIFIED clause has no effect on initialization by the VALUE clause.
BLANK WHEN ZERO Clause
The BLANK WHEN ZERO clause fills an item with spaces when its value is 0.
218 Data Division