The SYNCHRONIZED Clause

The SYNCHRONIZED clause specifies the alignment of an elementary item on the natural boundaries of the computer memory.

XOPEN Although it is a part of the standard COBOL definition, this feature is explicitly excluded from the X/Open COBOL language definitions and should not be used in a conforming X/Open COBOL source program.

General Format


Syntax for General Format for the SYNCHRONIZED clause

Directives

  1. In addition to Compiler directives which provide flagging and modify the reserved word list, the following directive may impact either the syntax or the semantics described in this section.
    • IBMCOMP - When NOIBMCOMP is specified, the SYNCHRONIZED clause is treated as documentary only.

Syntax Rules

  1. This clause should appear only with an elementary item.

    OSVSVSC2 The SYNCHRONIZED clause can appear with a non-elementary item.

  2. SYNC is an abbreviation for SYNCHRONIZED.

General Rules

  1. SYNCHRONIZED RIGHT specifies that the elementary item is to be positioned so that it terminates on the right character position of the natural boundary in which the elementary item is placed.

    It takes effect only if the IBMCOMP Compiler directive is set.

  2. Specification of the LEFT phrase in the SYNCHRONIZED clause has no effect.
  3. The effect of the SYNCHRONIZED clause is, by definition, implementation-dependent.
  4. This clause specifies that the subject data item is to be aligned in the computer so that no other data item occupies any of the character positions between the leftmost and rightmost natural boundaries of the computer memory which delimits this data item.

    If the number of character positions required to store this data item is less than the number of character positions between those natural boundaries, the unused character positions (or portions thereof) must not be used for any other data item. Such unused character positions are, however, included in:

    1. The size of any group item(s) to which the elementary item belongs, and:
    2. The character positions redefined when this data item is the object of a REDEFINES clause.

    Thus the size of an elementary item is unchanged by the SYNCHRONIZED clause, but extra character positions are assigned by the use of the clause.

  5. SYNCHRONIZED not followed by either RIGHT or LEFT specifies that the elementary item is to be positioned between natural boundaries so that it uses the elementary data item efficiently.
  6. Whenever a SYNCHRONIZED item is referenced , the original size of the item, as shown in the PICTURE clause, is used in determining any action that depends on size, such as justification, truncation or overflow.
  7. If the data description of an item contains the SYNCHRONIZED clause and an operational sign, the sign of the item appears in the normal operational sign position, regardless of whether the item is SYNCHRONIZED LEFT or SYNCHRONIZED RIGHT.
  8. When the SYNCHRONIZED clause is specified in a data description entry of a data item that also contains an OCCURS clause, or in a data description entry of a data item subordinate to a data description entry that contains an OCCURS clause, then:
    1. Each occurrence of the data item is SYNCHRONIZED.
    2. Any implicit FILLER generated for other data items within that same table is generated for each occurrence of those data items.
  9. OSVSVSC2 If the SYNCHRONIZED clause is specified with a non-elementary item, then the clause applies to all the items subordinate to that non-elementary item.
  10. The effect of using the SYNCHRONIZED clause is discussed in the topic Selection of Character Representation and Radix in the chapter Concepts of the COBOL Language.