ILE COBOL Language Reference


INITIALIZE Statement

The INITIALIZE statement sets selected categories of data fields to predetermined values. It is functionally equivalent to one or more MOVE statements.

INITIALIZE Statement - Format
 
               .--------------.
               V              |
>>-INITIALIZE----identifier-1-+--------------------------------->
 
>--+-------------------------------------------------------+---><
   |            .----------------------------------------. |
   |            V                                        | |
   '-REPLACING----+-ALPHABETIC----------+--| BY Phrase |-+-'
                  +-ALPHANUMERIC--------+
                  +-NUMERIC-------------+
                  +-ALPHANUMERIC-EDITED-+
                  +-NUMERIC-EDITED------+
                  |      (1)            |
                  +-DBCS----------------+
                  |             (1)     |
                  +-DBCS-EDITED---------+
                  |          (1)        |
                  '-NATIONAL------------'
 
BY Phrase:
 
|--+------+--BY--+-identifier-2-+-------------------------------|
   '-DATA-'      '-literal-1----'
 
 

Notes:

  1. IBM Extension

identifier-1
Receiving area(s).
identifier-2, literal-1
Sending area(s).

Identifier-1 can be a subscripted or reference-modified item. A complete table can be initialized if identifier-1 is a group item that contains the complete table.

Neither identifier-1 nor any item subordinate to it may contain the DEPENDING ON phrase of the OCCURS clause. The data description entry for identifier-1 must not contain a RENAMES clause. An index data item may not be an operand of INITIALIZE.

Note:
You cannot use the INITIALIZE statement to initialize a variably located item or group that follows a DEPENDING ON phrase of an OCCURS clause within the same 01 level.

+-------------------------------IBM Extension--------------------------------+

A floating-point data item or literal can be used anywhere a numeric identifier or literal is specified.

A DBCS or national data item or literal can be used anywhere an identifier or literal is specified.

+----------------------------End of IBM Extension----------------------------+

Related Information:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]