COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

item and copies it to delimstore in accordance with the rules for the MOVE statement.
If the delimiting condition is the end of the sending area (that is, there is no delimiter
string), then the unstring operation fills the delimiter data item with spaces.
If the delimiter is described as a figurative constant with the ALL qualifier, only one
occurrence of the unqualified figurative constant is moved.
If you execute
UNSTRING U DELIMITED BY SPACE OR "."
INTO WORD-1 DELIMITER IN DEL-1
...
WORD-5 DELIMITER IN DEL-5
you get
"The "
in WORD-1,
" "
in DEL-1, and so on down to
"handy "
in WORD-5 and
"."
in DEL-5.
If you include the DELIMITER phrase in the INTO phrase for this cycle, the unstring
operation advances the current character position in the sending area to the first character
following the delimiter string located in this cycle.
If the specification of the matched delimiter includes the keyword ALL and the portion of
the sending area following the delimiter string contains one or more repetitions of that
set of characters, then the unstring operation advances the current character position past
all repetitions; therefore the unstring operation considers two or more contiguous
occurrences of the matched delimiter string as equivalent to a single occurrence in
determining the beginning character for the next examination cycle.
If you include a COUNT phrase in the INTO phrase for this cycle, the unstring operation
assigns the numeric value equal to the number of characters examined (excluding the
delimiter string, if any) to count in accordance with the rules for an elementary move
operation.
If you execute
UNSTRING U DELIMITED BY SPACE OR "."
INTO WORD-1 COUNT IN COUNT-1
...
WORD-5 COUNT IN COUNT-5
you get
"The "
in WORD-1, but 3 in COUNT-1, and you get
"stateme"
in WORD-3 but 9 in COUNT-3.
If you include the POINTER phrase, the unstring operation increments the value of the
pointer item by one for each character examined as a part of this cycle. This includes
each character in the value copied to the receiving area, each character in the delimiter
string (if any), and each character in any contiguous repetitions of the delimiter string;
therefore the resulting value of the pointer variable reflects the relative character position
within the sending area at which the next cycle begins.
480 Procedure Division Verbs