COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-92
INITIALIZE
specifies the category of elementary item in receiver to which the INITIALIZE
operation is to assign a value. The default replacement is ZEROS for each
NUMERIC or NUMERIC-EDITED receiver and SPACES for each
ALPHABETIC, ALPHANUMERIC, or ALPHANUMERIC-EDITED receiver. The
receiver is in one of these categories whether you specify replacement or
not (see PICTURE Clause).
ALPHABETIC
ALPHANUMERIC
NUMERIC
ALPHANUMERIC-EDITED
NUMERIC-EDITED
are categories defined in PICTURE Clause. The category you specify must be
permitted for a receiving operand in a MOVE statement where the
corresponding sending operand is sender or literal. You cannot specify a
category more than once in a single INITIALIZE statement.
sender
is the identifier of a data item from which the INITIALIZE statement obtains a
value to store into the elementary items specified by receiver. The sender
cannot be a national or index data item.
literal
is the representation of a value that the INITIALIZE statement stores into the
elementary item specified by receiver. literal cannot be a national literal.
The INITIALIZE statements in Example 9-35 assign initial values to data structures
composed of counters and pointers that a program uses for UNSTRING and INSPECT
statements. In the first statement, the REPLACING phrase can be omitted if
UNSTRING-COUNTERS and INSPECT-COUNTERS are numeric.
The INITIALIZE statement in Example 9-36 assigns a value of zero to only the
numeric-edited items in a table composed of a variety of categories.
Example 9-35. INITIALIZE Statements
INITIALIZE UNSTRING-COUNTERS
INSPECT-COUNTERS
REPLACING NUMERIC DATA BY ZERO
INITIALIZE UNSTRING-POINTERS
INSPECT-POINTERS
REPLACING NUMERIC DATA BY 1