Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)
Data Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual—426750-003
5-18
SYNCHRONIZED Clause
•
Special considerations apply when aligning an elementary data item that is
described with an OCCURS clause, is subordinate to a group item described with
an OCCURS clause, or both. In these cases, all occurrences of the data item must
be aligned uniformly.
°
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). When the aligned item is itself a table, the first occurrence ends on the
appropriate storage boundary (byte, word, doubleword) and the remaining
occurrences follow without additional FILLER bytes.
°
When the aligned item (or table of aligned items) belongs to a higher-level
table, further adjustment might be necessary. If the elementary item is word-
aligned and the containing group occurrence consists of an odd number of
character positions, the compiler inserts one byte of FILLER data after each
group occurrence. If the item is doubleword aligned and the size of the
containing group occurrence is not a multiple of four, the compiler inserts the
appropriate amount of FILLER data (1, 2, or 3 bytes) after each group
occurrence. In all cases, inserted bytes are not part of the containing
occurrences themselves, but are included in group items that contain the
complete table. The preceding sequence is repeated for each higher-level
table.
The following example illustrates alignment as it applies to multiple OCCURS clauses:
01 master.
02 table-1 OCCURS 5 TIMES.
03 table-2 OCCURS 5 TIMES.
04 table-3 OCCURS 5 TIMES.
05 item-a PIC 999 COMPUTATIONAL.
05 item-b PIC X.
04 item-3 PIC X.
03 item-2 PIC X.
Although master appears to occupy this many bytes:
(((2+1) * 5+1 ) * 5+1) * 5 = 405 bytes
it actually occupies:
((2+1+1) * 5+1+1) * 5+1+1) * 5 = 560 bytes
due to the alignment requirement for the COMPUTATIONAL item.
Implicit FILLER bytes must be accounted for in several situations. These bytes are
counted when determining the size of group items that contain them. Thus, when a
data item contains implicit FILLER bytes, the character positions of the bytes are
included in the allocation requirements of the item. Also, implicit FILLER bytes must
be included among the character positions redefined if a containing group item
appears as the object of a REDEFINES clause.










