Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


Figure description: UNSTRING statement

This figure illustrates the processing of an UNSTRING statement. The following statement is used in this description:

UNSTRING send-id DELIMITED BY delimiter-id OR ALL “*”
INTO receiver-id1 DELIMITER IN delim-1 COUNT IN cnt1
     receiver-id2 DELIMITER IN delim-2
     reciever-id3 DELIMITER IN delim-3 COUNT IN cnt3
WITH POINTER pointer-1
TALLYING IN tally-field-1
ON OVERFLOW GO TO overflow-exit.
END-UNSTRING

The following are initial data values:

Each receiving delimiter field is one character in length.

The data in Send-id is examined from left to right. The following are the processing steps:

  1. For receiver-id1:
  2. For receiver-id2:
  3. For receiver-id3:
  4. For receiver-id4:
  5. Tally-field-1 is set to 5 (the number of fields transferred plus 1).
  6. Pointer-1 is set to 21 (the length of the sending field plus 1).

The branch to overflow-exit is not taken because all the characters in send-id were examined.

End figure description.


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)