COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-275
UNSTRING
tally
is the identifier of an integer data item to which the unstring operation adds the
number of result data items it stored. The UNSTRING statement does not
initialize tally but adds to its current value. If you want tally to begin at a
given number, set it before the UNSTRING statement executes.
tally cannot reference a special register.
imperative-stmt-1
is an imperative statement to be executed when overflow occurs; that is, when
these conditions exist:
The initial value of pointer is less than 1 or greater than the length of
source.
All data-receiving areas have been acted upon, and source still contains
unexamined characters.
If you do not specify an OVERFLOW clause and an overflow occurs, control
passes to the next statement after UNSTRING.
imperative-stmt-2
is an imperative statement to be executed when overflow does not occur.
END-UNSTRING
ends the scope of the UNSTRING statement, causing the UNSTRING to be a
delimited-scope statement. If you omit the END-UNSTRING phrase, the presence
of the OVERFLOW or the NOT OVERFLOW phrase makes the UNSTRING
statement a conditional statement, which ends at the next period separator.
Usage Considerations:
Purpose
In general terms, the UNSTRING statement partitions the value of the sending
area (referenced by source ) into a sequence of strings of consecutive characters
and stores them in the receiving areas (referenced by a list of one or more
instances of result).