Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)

Data Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual426750-001
5-18
SYNCHRONIZED Clause
°
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.
Automatic alignment or requested alignment of data items described by redefinition of
character positions (through use of the REDEFINES clause) follows the rules described
in the preceding paragraphs. However, when the first data item allocated by a
redefinition requires word alignment or doubleword alignment, the data item being
redefined must begin on the appropriate boundary. In other words, SCREEN COBOL
does not permit redefinitions that require insertion of implicit FILLER bytes before the
first data item of the redefinition. Any bytes inserted at other places within the
redefinition are counted when determining the redefinition size.