The UNSTRING statement causes contiguous data in a sending field to be separated and placed into multiple receiving fields.
One UNSTRING statement can be written instead of a series of MOVE statements.
UNSTRING Statement - Format
>>-UNSTRING--identifier-1--------------------------------------->
>--+-------------------------------------------------------------+-->
'-DELIMITED--+----+--+-----+--+-identifier-2-+--| OR Phrase |-'
'-BY-' '-ALL-' '-literal-1----'
>--INTO--------------------------------------------------------->
.------------------------------------------------------.
V |
>----identifier-4--| DELIMITER Phrase |--| COUNT Phrase |-+----->
>--+---------------------------------+-------------------------->
'-+------+--POINTER--identifier-7-'
'-WITH-'
>--+--------------------------------+--------------------------->
'-TALLYING--+----+--identifier-8-'
'-IN-'
>--+------------------------------------------+----------------->
'-+----+--OVERFLOW--imperative-statement-1-'
'-ON-'
>--+-----------------------------------------------+------------>
'-NOT--+----+--OVERFLOW--imperative-statement-2-'
'-ON-'
>--+--------------+--------------------------------------------><
'-END-UNSTRING-'
OR Phrase:
|--+-----------------------------------+------------------------|
| .-------------------------------. |
| V | |
'---OR--+-----+--+-identifier-3-+-+-'
'-ALL-' '-literal-2----'
DELIMITER Phrase:
|--+---------------------------------+--------------------------|
'-DELIMITER--+----+--identifier-5-'
'-IN-'
COUNT Phrase:
|--+-----------------------------+------------------------------|
'-COUNT--+----+--identifier-6-'
'-IN-'
Related Information:
It must be an alphanumeric data item; it cannot be reference modified. Data is transferred from this field to the receiving fields.
+-------------------------------IBM Extension--------------------------------+
Identifier-1 can be a DBCS data-item.
+----------------------------End of IBM Extension----------------------------+
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.