The UNSTRING statement separates contiguous data in a sending field and stores it in one or more receiving fields. Format - UNSTRING src-string [ DELIMITED BY [ALL] delim [ OR [ALL] delim ] ... ] INTO { dest-string [DELIMITER IN delim-dest] [COUNT IN countr] } ... [ WITH POINTER pointr ] [ TALLYING IN tally-ctr ] [ ON OVERFLOW stment ] [ NOT ON OVERFLOW stment ] [ END-UNSTRING ]
1 – src-string
is the identifier of an alphanumeric class data item. It cannot be reference modified. Src-string is the sending field.
2 – delim
is a nonumeric literal or the identifier of an alphanumeric data item. It is the delimiter for the UNSTRING operation.
3 – dest-string
is the identifier of an alphanumeric, alphabetic, or numeric DISPLAY data item. It is the receiving field for the data from src-string.
4 – delim-dest
is the identifier of an alphanumeric data item. It is the receiving field for delimiters.
5 – countr
is the identifier of an elementary numeric data item described as an integer. It contains the count of characters moved.
6 – pointr
is the identifier of an elementary numeric data item described as an integer. It points to the current character position in src-string.
7 – tally-ctr
is the identifier of an elementary numeric data item described as an integer. It counts the number of dest-string fields accessed during the UNSTRING operation.
8 – stment
is an imperative statement.