Aligning bit data.
Alignment of elementary bit data items and bit group items within a record, when an ALIGNED clause is not specified, is at the next bit position in storage when that item is:
- an elementary bit data item immediately following an elementary bit data item or bit group item of the same level
- bit group item immediately following a bit group item or elementary bit data item of the same level
Alignment of elementary bit data items of level 1 or level 77 and a level 1 bit group are at the first bit of a byte.
Implicit filler bit positions are generated:
- Following a bit data item within an alphanumeric group item, within a strongly-typed group item, or within a bit group item, as needed to advance alignment to a required natural boundary for the next item within that group. The filler bit positions are implicitly described as a filler elementary bit data item of the necessary number of bits and of the same level number as the next item within that group.
- Following a bit data item that is the last data item in a record that is an alphanumeric group or strongly-typed group item, as needed to increase the number of bits to fill an integral number of characters. The filler bit positions are implicitly described as a filler elementary bit data item of the necessary number of bits with a level number the same as the highest hierarchical level of any bit data item superordinate to the last item, or, if there is no such superordinate item, the same as the level number of the last data item in the record.
Note: No filler is generated at the end of a record that is entirely a bit group, at the end of a level 77 item, or at the end of a level 1 elementary item.
The alignment of the start of a group item and the alignment of the first item within that group, when the first item is a bit data item, are at the same bit position in storage.
Note: Using the SYNCHRONIZED clause has no effect on the alignment of any type of bit data items.