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).
       [10  SLACK-BYTES           PIC XX.  INSERTED BY COMPILER]

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:

  1. WORD-CODE occupies 1 byte.
  2. COMP-TYPE occupies 1 byte.
  3. Slack Bytes occupies 2 bytes.
  4. COMP-PAY occupies 4 bytes.
  5. COMP-HOURS occupies 2 bytes.
  6. COMP-NAME occupies 5 bytes.
  7. Slack Bytes occupies 2 bytes.

The first occurrence of COMP-TABLE starts at the beginning of COMP-TYPE and contains 16 bytes.

The second occurrence of COMP-TABLE starts at the end of the first occurrence of COMP-TABLE and contains 16 bytes.

End of figure description.