


The INITIALIZE statement sets selected types of elementary data items to chosen values.
General Format
INITIALIZE { destination } ...
[ 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 contain the DEPENDING phrase of the OCCURS clause, nor may any of its subordinate data items.
5. Destination may not be an index data item.
6. 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:
a) 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.
b) If destination is an elementary item, that item is initialized only if it belongs to a category specified in the REPLACING phrase.
c) 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.
d) 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.
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.