Figure description: Slack bytes within records
This figure illustrates the storage layout of a record that is defined by the following statement:
01 WORK-RECORD.
05 WORK-CODE PICTURE X.
05 COMP-TABLE OCCURS 10 TIMES.
10 COMP-TYPE PICTURE X.
[10 SLACK-BYTES PIC XX. INSERTED BY COMPILER]
10 COMP-PAY PICTURE S9(4)V99 COMP SYNC.
10 COMP-HOURS PICTURE S9(3) COMP SYNC.
10 COMP-NAME PICTURE X(5).
The figure uses a horizon line with linear measurement markings to show the storage space. The distance between two adjacent markings stands for 1 byte. The following labels are marked below the line:
- D: Stands for doubleword boundary. Two adjacent Ds are 8 bytes apart.
- F: Stands for fullword boundary. Two adjacent Fs are 4 bytes apart.
- H: Stands for halfword boundary. Two adjacent Hs are 2 bytes apart.
Above the line, from left to right, the following items are shown in sequence:
WORD-CODE
occupies 1 byte.COMP-TYPE
occupies 1 byte.Slack Bytes
occupies 2 bytes.COMP-PAY
occupies 4 bytes.COMP-HOURS
occupies 2 bytes.COMP-NAME
occupies 5 bytes.
The first occurrence of COMP-TABLE
starts at the beginning of COMP-TYPE
and ends at the end of COMP-NAME
.
End of figure description.