INITIALIZE Statement

The INITIALIZE statement sets selected types of elementary data items to chosen values.

General Format

INITIALIZE { destination } ... [ WITH FILLER ]

[ REPLACING { {ALPHABETIC         } DATA BY value }...]
              {ALPHANUMERIC       }
              {NUMERIC            }
              {ALPHANUMERIC-EDITED}
              {NUMERIC-EDITED     }

Syntax Rules

  1. destination is a data item.
  2. value is a literal or a data item. It must be a legal source for a MOVE to the corresponding category of data. For example, a value appearing in a REPLACING ALPHABETIC BY clause must have a category of alphabetic, alphanumeric, or alphanumeric-edited.
  3. The same category cannot be repeated in a REPLACING phrase.
  4. destination may not be an index data item.
  5. destination may not contain a RENAMES clause.

General Rules

  1. Whether destination references an elementary item or a group item, all operations are performed as if a series of MOVE statements had been written, each of which has an elementary item as its receiving field according to the following rules:
    1. If destination is a group item, any elementary item contained in destination is initialized only if it belongs to a category specified by the REPLACING phrase.
    2. If destination is an elementary item, that item is initialized only if it belongs to a category specified in the REPLACING phrase.
    3. Each data item that is initialized is treated as the receiving operand of an implicit MOVE statement with the corresponding value as the sending field.
    4. All elementary receiving fields, including all table occurrences, are affected, except as specified in the following rules.
  2. Index data items and elementary FILLER data items are not affected by the INITIALIZE statement, unless the optional WITH FILLER phrase is specified, in which case FILLER data items are initialized.
  3. Any item that is subordinate to destination and which contains a REDEFINES clause, or any item that is subordinate to such an item, is excluded from this operation. Destination itself, however, may be subordinate to a REDEFINES clause.
  4. If no REPLACING phrase is specified, alphabetic, alphanumeric, and alphanumeric-edited data items are initialized to SPACES; numeric and numeric-edited data items are initialized to ZEROS.
  5. If multiple destinations are specified, they are initialized in the order written.
  6. destinations that are or contain OCCURS DEPENDING ON items will use the maximum number of occurrences when being initialized.