The INITIALIZE statement sets selected categories of data fields to predetermined values. It is functionally equivalent to one or more MOVE statements.
Format .--------------. V | >>-INITIALIZE----identifier-1-+---------------------------------> >--+------------------------------------------------------------------------+->< | .---------------------------------------------------------. | | V | | '-REPLACING----+-ALPHABETIC----------+--+------+--BY--+-identifier-2-+-+-' +-ALPHANUMERIC--------+ '-DATA-' '-literal-1----' +-ALPHANUMERIC-EDITED-+ +-NATIONAL------------+ +-NATIONAL-EDITED-----+ +-NUMERIC-------------+ +-NUMERIC-EDITED------+ +-DBCS----------------+ '-EGCS----------------'
identifier-1 must reference one of the following:
When identifier-1 references a national group item, identifier-1 is processed as a group item.
When identifier-2 references a national group item, identifier-2 is processed as an elementary data item of category national.
identifier-2 must reference an elementary data item (or a national group item treated as elementary) that is valid as a sending operand in a MOVE statement with identifier-1 as the receiving operand.
literal-1 must be a literal that is valid as a sending operand in a MOVE statement with identifier-1 as the receiving operand.
A subscripted item can be specified for identifier-1. A complete table can be initialized only by specifying identifier-1 as a group that contains the complete table.
Usage note: The data description entry for identifier-1 can contain the DEPENDING phrase of the OCCURS clause. However, you cannot use the INITIALIZE statement to initialize a variably-located item or a variable-length item.
The data description entry for identifier-1 must not contain a RENAMES clause.
Special registers can be specified for identifier-1 and identifier-2 only if they are valid receiving fields or sending fields, respectively, for the implied MOVE statements.
When the REPLACING phrase is specified:
The keyword following the word REPLACING corresponds to a category of data shown in Classes and categories of data.
When the REPLACING phrase is not specified:
If the REPLACING phrase is specified:
Initialization takes place as if the data item referenced by identifier-2 or literal-1 were the sending operand in an implicit MOVE statement to the receiving item.
All elementary receiving fields, including all occurrences of table items within the group, are initialized, with the following exceptions: