ILE COBOL Language Reference

INSPECT Statement - Format 4

INSPECT Statement - Format 4
 
>>-INSPECT--identifier-1--CONVERTING--+-identifier-6-+--TO------>
                                      '-literal-4----'
 
>--+-identifier-7-+--------------------------------------------->
   '-literal-5----'
 
   .-----------------------------------------------.
   V                                               |
>----+-------------------------------------------+-+-----------><
     '-+-BEFORE-+--+---------+--+-identifier-4-+-'
       '-AFTER--'  '-INITIAL-'  '-literal-2----'
 
 
identifier-1
Is the inspected item; an elementary or group item with USAGE DISPLAY.

In Format-1, identifier-1 is a sending item. In the other formats, it is treated as a sending data item for the purpose of determining its length.

identifier-2
Must be an elementary numeric data item.
identifier-3 . . . identifier-7
Must be elementary data items with USAGE DISPLAY.

For use in the INSPECT statement, the content of each data item referenced by all identifiers except identifier-2 (the count field) is treated as follows:

ALPHABETIC OR ALPHANUMERIC ITEM

Treated as a character string.
ALPHANUMERIC-EDITED, NUMERIC-EDITED, OR UNSIGNED NUMERIC (EXTERNAL DECIMAL) ITEM
Treated as if defined as alphanumeric with the INSPECT statement referring to the alphanumeric item.
SIGNED NUMERIC (EXTERNAL DECIMAL) ITEM
Treated as if moved to an unsigned external decimal item of the same length, and then redefined as alphanumeric, with the INSPECT statement referring to the alphanumeric item. If the sign is a separate character, the byte containing the sign is not examined and, therefore, not replaced.
literal-1 . . . literal-5
Must be nonnumeric and may be any figurative constant that does not begin with the word ALL.

If literal-1, literal-2, or literal-4 is a figurative constant, it refers to an implicit one character data item.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]