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


Figure description: INSPECT statement

This figure illustrates processing steps for the following INSPECT statement:

INSPECT ID-1 TALLYING ID-2 FOR ALL “**” REPLACING ALL “**” BY ZEROS.
  1. Initial data values are shown as follows:
  2. The INSPECT statement scans ID-1 left to right.
  3. The first occurrence of “**” is found at the start of ID-1. The characters “**” are replaced by “00”. The counter, ID-2, is incremented by 1.
  4. The next occurrence of “**” is found at the end of ID-1. Again “**” is replaced by “00” and the counter is incremented.
  5. INSPECT statement processing ends. Data values are as follows:

End of figure description.


Terms of use | Feedback

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