Inspect Manual

Using Inspect With COBOL and SCREEN COBOL
Inspect Manual429164-006
10-6
Usage Considerations
identifier
specifies a data item in the program unit.
OF identifier
specifies the group data-item in which the given data item is declared. Like
COBOL, Inspect requires only enough qualification to identify the data item
uniquely.
index
specifies the subscript of an array element or the subscript range of a group of
array elements.
Usage Considerations
Any COBOL data location to which you refer must be a data item defined in a
program unit that was compiled with the SYMBOLS directive. The location can be
anywhere in the DATA DIVISION of an active scope unit.
You must qualify a data reference enough to identify a data item uniquely. If a data
reference identifies more than one data item, Inspect issues an error message
stating that the reference is ambiguous (except when you are using the INFO
IDENTIFIER command; in this case, Inspect reports all occurrences of the
identifier in the scope unit).
Inspect does not support the examination or modification of items in the SCREEN
SECTION of a SCREEN COBOL program.
You can use the regular COBOL subscripts to refer to a specific item in a table.
Inspect also allows you to specify a range of subscripts for DISPLAY or MODIFY
commands. For example:
-COBOBJ-DISPLAY payscale-table(1:3, 1:4)
Inspect requires that subscripts be separated by commas; in COBOL, commas are
optional.
A data location cannot include mnemonic names.
Inspect does not support the examination or modification of COBOL items whose
usage is INDEX. For example, if the table X-TAB is indexed by X, Inspect will
reject commands such as:
-COBOBJ-DISPLAY x-tab(x)
-COBOBJ-MODIFY x
-COBOBJ-MODIFY zz = z + x-tab (x)