Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)

Data Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual426750-003
5-17
SYNCHRONIZED Clause
A VALUE clause must not appear for any group item that has a subordinate item
described with the SYNCHRONIZED clause.
In most cases, the alignment supplied automatically by the compiler is the most
natural; however, the SYNCHRONIZED clause affects alignment in a few special
cases. Alignment considerations are as follows:
Alignment requirements can cause SCREEN COBOL to generate implicit FILLER
data. The existence of this generated data must be accounted for in certain
situations.
DISPLAY items are composed of one or more character positions and are stored
as an equal number of 8-bit bytes. The byte boundary is their natural storage
boundary; therefore, the SYNCHRONIZED clause has no effect on DISPLAY item
alignment.
COMPUTATIONAL items are stored as an even multiple of bytes. Their most
natural storage unit is some multiple of the 16-bit computer word; each of these
words contains two bytes. The SCREEN COBOL compiler automatically aligns
COMPUTATIONAL items to word boundaries. This is also the natural boundary for
small COMPUTATIONAL items (those items with PICTURE strings containing up to
four 9s).
Larger COMPUTATIONAL items (those items with pictures containing five or more
9s) are naturally stored as one or two 32-bit doublewords. The SYNCHRONIZED
clause affects these items; it forces alignment on a doubleword boundary.
All items of levels 01 and 77 in the Working-Storage Section and Linkage Section
are automatically allocated by the SCREEN COBOL compiler to begin on a word
boundary. The compiler treats these items as simultaneously beginning on a byte,
word, and doubleword boundary. Thus, each of these items is aligned to its most
natural storage boundary.
Words begin on two-byte boundaries; doublewords begin on four-byte boundaries.
Alignment, either automatic or as requested by use of the SYNCHRONIZED
clause, generates implicit FILLER data in some cases.
°
If an odd number of character positions precedes a word-aligned item within a
record, the compiler inserts one character position (byte) of FILLER data
before the item to complete allocation of the preceding word.
°
If the number of character positions preceding a doubleword aligned item
within a record is not a multiple of four, the compiler inserts FILLER data (1, 2,
or 3 bytes) to complete allocation of the preceding doubleword. These extra
bytes are not part of the data item.
°
If a group item contains two items separated by implicit FILLER bytes, these
bytes are a part of that group item. A group item always begins with the first
character position of its first elementary item, however, ignoring any implicit
FILLER bytes that were generated to align that item properly. Thus, the initial
character positions of a group item are never implicit FILLER bytes.