Example of Insertion of a Slack Bit (1)
Below is an example of a slack bit insertion for the following record description
entry.
Código COBOL:
01 RECORD-A.
02 DATA-A1.
03 DATA-A11 PIC 1(4) BIT.
03 DATA-A12 PIC 1(3) BIT SYNC.
03 DATA-A13 PIC 1(5) BIT.
02 DATA-A2 PIC 1(4) BIT.
DATA-A12 is allocated to a one-byte boundary, so four slack bits are inserted
between DATA-A11 and DATA-A12.
A one-byte area is allocated to DATA-A12, so five slack bits are inserted between
DATA-A12 and DATA-A13.
DATA-A13 is the last internal Boolean data item subordinate to DATA-A1, so three
slack bits are inserted after DATA-A13.
The above record description entry is equivalent to the example shown below.
Código COBOL:
01 RECORD-A.
02 DATA-A1.
03 DATA-A11 PIC 1(4) BIT.
03 FILLER PIC 1(4) BIT. <-- Slack bit
03 DATA-A12 PIC 1(3) BIT.
03 FILLER PIC 1(5) BIT. <-- Slack bit
03 DATA-A13 PIC 1(5) BIT.
03 FILLER PIC 1(3) BIT. <-- Slack bit
02 DATA-A2 PIC 1(4) BIT.
Example of Insertion of a Slack Bit (2)
Below is an example of a slack bit insertion in a group item where an OCCURS clause
has been specified for the following record description entry.
Código COBOL:
01 RECORD-B.
02 DATA-B1 OCCURS 10 TIMES.
03 DATA-B11 PIC 1(5) BIT.
03 DATA-B12 PIC 1(5) BIT.
DATA-B1 is allocated to begin on a one-byte boundary where DATA-B1 is repeated.
Therefore, six slack bits are inserted after DATA-B12. The slack bits inserting method
is the same as the repetition of DATA-B1.
When an OCCURS clause has been specified in a Boolean data item containing no
SYNCHRONIZED clause, no slack bit is inserted between each table element
occurrence. For example, no slack bit is inserted between each occurrence of DATAC1 in the case shown below.
Código COBOL:
02 DATA-C1 PIC 1(3) BIT OCCURS 6.