INITIALIZE statement rules

The effect of the execution of an INITIALIZE statement is as if a series of implicit MOVE statements, each of which has an elementary data item as its receiving operand, were executed. The receiving operands of these implicit statements are defined in rule 1 and the sending operands are defined in rule 2.

  1. The receiving operand in each implicit MOVE statement is determined by applying the rules a, b, and c in the order they appear below. Note that if a data item is not excluded as a receiver by a particular rule, it may be excluded as a receiver when a subsequent rule is applied. For example, if a data item is not excluded by rule a, that data item may still be excluded by rule b or rule c.
    1. First, the following data items are excluded as receiving operands:
      • Any identifiers that are not valid receiving operands of a MOVE statement.
      • Elementary data items that have an explicit or implicit FILLER clause if the FILLER phrase is not specified.
      • Any elementary data item subordinate to identifier-1 whose data description entry contains a REDEFINES or RENAMES clause or is subordinate to a data item whose data description entry contains a REDEFINES clause. However, identifier-1 might itself have a REDEFINES clause or be subordinate to a data item with a REDEFINES clause.
    2. Second, an elementary data item is a possible receiving item in either of the following cases:
      • It is explicitly referenced by identifier-1.
      • It is contained within the group data item referenced by identifier-1. If the elementary data item is a table element, each occurrence of the elementary data item is a possible receiving operand.
    3. Finally, each possible receiving operand is a receiving operand if at least one of the following conditions is true:
      • The VALUE phrase is specified, the category of the elementary data item is one of the categories specified or implied in the VALUE phrase, and either of the following conditions is true:
        • A data-item format VALUE clause is specified in the data description entry of the elementary data item.
        • A table format VALUE clause is specified in the data description entry of the elementary item and that VALUE clause specifies a value for the particular occurrence of the elementary data item.
      • The REPLACING phrase is specified and the category of the elementary data item is one of the categories specified in the REPLACING phrase.
      • The DEFAULT phrase is specified.
      • Neither the REPLACING phrase nor the VALUE phrase is specified.
  2. The sending operand in each implicit MOVE statement is determined as follows:
    • If the data item qualifies as a receiving operand because of the VALUE phrase, the sending operand is determined by the literal in the VALUE clause specified in the data description entry of the data item. If the data item is a table element, the literal in the VALUE clause that corresponds to the occurrence being initialized determines the sending operand. The actual sending operand is a literal that, when moved to the receiving operand with a MOVE statement, produces the same result as the initial value of the data item as produced by the application of the VALUE clause.
    • If the data item does not qualify as a receiving operand because of the VALUE phrase, but does qualify because of the REPLACING phrase, the sending operand is the literal-1 or identifier-2 associated with the category specified in the REPLACING phrase.
    • If the data item does not qualify in accordance with the preceding two rules, the sending operand used depends on the category of the receiving operand as follows:
      • SPACE is the implied sending item for receiving items of category alphabetic, alphanumeric, alphanumeric-edited, DBCS, EGCS, national, national-edited, or UTF-8.
      • ZERO is the implied sending item for receiving items of category numeric or numeric-edited.