Native Inspect Manual (H06.07+)

Using Native Inspect With COBOL Programs
Native Inspect Manual528122-006
3-4
Specifying Tables With Variable Upper Bounds
Examples of valid table references are:
MODEL (3)
STYLE OF MODEL (3,11)
COLOR OF STYLE OF MODEL (3,11,14)
MODEL.STYLE.COLOR (3,11,14)
You reference an entire table by specifying the table name without subscripts. For
example, the following command displays all elements of table TOTAL-A:
print TOTAL-A
Subscripts are used to refer to specific instances of scalar variables that are part of a
table of records. For example, consider the following declaration:
01 MASTER.
02 TABLE-1 OCCURS 5 TIMES.
03 TABLE-2 OCCURS 5 TIMES.
04 ELEMENT PIC X.
An example of a reference to an instance of the scalar variable ELEMENT is:
ELEMENT (3, 2)
This example specifies the value of ELEMENT that is contained in the third occurrence
of TABLE-1 and the second occurrence of TABLE-2.
Specifying Tables With Variable Upper Bounds
You can declare COBOL tables with a variable upper bound. For example:
01 MASTER.
03 TABLE OCCURS 5 TO 10 TIMES DEPENDING ON ITEM.
If, in a Native Inspect print command, you specify the table name with no subscripts to
print the entire table, Native Inspect evaluates the variable upper bound specified with
the DEPENDING ON keywords to determine the number of elements to display.
However, in rare situations where Native Inspect is unable to evaluate the variable
upper bound, the table is displayed up to the maximum specified by the OCCURS
keyword.
In the preceding declaration, if you specify:
print TABLE
Native Inspect attempts to evaluate the variable ITEM to determine the number of
elements to display.