COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-274
UNSTRING
result
specifies the identifier of an alphanumeric, alphabetic, or numeric DISPLAY
elementary data item into which the unstring operation copies characters from
source. If result identifies a numeric data item, the PICTURE clause that
describes it cannot contain any P s.
result cannot reference a special register.
An UNSTRING statement can have at most 127 result fields.
delimstore
is the identifier of an alphanumeric data item. You can only use the
DELIMITER phrase when you also use the DELIMITED phrase. The unstring
operation copies the character or characters of source that matched the
delimiter specified in the DELIMITED phrase to delimstore. delimstore
cannot reference a special register.
count
is the identifier of an integer data item. You can only use the COUNT phrase
when you also use the DELIMITED phrase. The unstring operation stores in
count the number of characters it moved to result. If it did not move any
characters, the unstring operation does not alter the value of count, so you
must initialize count to a known value if you want to use it to determine
whether the UNSTRING statement moved any characters to result.
When the character-string from source is longer than result, the unstring
operation truncates it to fit into result, and stores into count the length
source had before it was truncated.
pointer
is the identifier of an integer data item. When you omit this phrase, the unstring
operation begins at the first character of the source data item. When you include
this phrase, the integer value in pointer specifies the position in the source data
item where the unstring operation begins. When the unstring operation completes,
the integer value in pointer specifies the position just beyond the last character
processed by the unstring operation (delimiter or portion copied to a result data
item).
pointer must reference a data item that is capable of containing a numeric value
equal to one plus the size of the item referenced by source. pointer cannot
reference a special register.