Synchronization and Offsets
In the preceding figure, note that A and B do not have to be following each other in actual storage. In other words, you cannot know if B starts 16 bytes after A's start, or 48 bytes (16 x 3), or 16 x N bytes. You must not attempt to retrieve synchronized data by specifying offsets.
The SYNCHRONIZED clause is implicit for pointer data and procedure-pointer data items. Pointer data and procedure-pointer data items declared in the Linkage Section are not synchronized.
The SYNCHRONIZED clause cannot be specified in the same data description entry as the TYPE clause.
The SYNCHRONIZED clause is ignored for a DBCS, national, external floating-point, date, time, or timestamp data item.
The SYNCHRONIZED clause for a COMPUTATIONAL-1 data item aligns the data on a fullword boundary.
The SYNCHRONIZED clause for a COMPUTATIONAL-2 data item aligns the data on a doubleword boundary.
End of IBM ExtensionDepending on the USAGE that is specified for an item, the SYNCHRONIZED clause has a particular effect. Table 1 shows how the USAGE of an item determines the effect of the SYNCHRONIZED clause upon it.
| If the USAGE is... | The SYNCHRONIZED clause... |
|---|---|
| DISPLAY | is syntax checked but does not affect execution |
| DISPLAY-1 (DBCS) | is ignored |
| NATIONAL | is ignored |
| PACKED-DECIMAL | is syntax checked but does not affect execution |
| COMPUTATIONAL-1 | aligns the data on a fullword boundary |
| COMPUTATIONAL-2 | aligns the data on a doubleword boundary |
| COMPUTATIONAL-3 | is syntax checked but does not affect execution |
BINARY: |
aligns data item at a multiple of 2 relative to the beginning of the record |
BINARY: |
aligns data item at a multiple of 4 relative to the beginning of the record |
BINARY: |
aligns data item at a multiple of 8 relative to the beginning of the record |
| COMPUTATIONAL-4 | functions the same as for USAGE BINARY |
| COMPUTATIONAL-5 | functions the same as for USAGE BINARY |
| COMPUTATIONAL | is syntax checked but does not affect execution |
| INDEX | is not permitted |
| POINTER | aligns data item at a multiple of 16 relative to the beginning of the record |
| PROCEDURE-POINTER | functions the same as for USAGE POINTER |
The length of an elementary item is not affected by the SYNCHRONIZED clause.