Displaying the Contents of a Table
Using EVAL on a table will result in a display of the current table element.
You can display the whole table using the range notation. For example, to
display a 3-element table, type:
EVAL TableA(1..3)
You can change the current element using the %INDEX built-in function.
To determine the value of the table index, enter the following command:
EVAL _QRNU_TABI_name
where name represents the
table name in question.Figure 1 shows the use of EVAL with the table in DBGEX.
Figure 1. Sample EVAL commands for a Table
3 DIM(3) CTDATA
Compile-time data: **
> EVAL TableA ** Show value at aaa
TABLEA = 'aaa' current index bbb
ccc
> EVAL TableA(1) ** Specify index 1 **
TABLEA(1) = 'aaa'
> EVAL TableA(2) ** Specify index 2 **
TABLEA(2) = 'bbb'
> EVAL _QRNU_TABI_TableA ** Display value of current index **
_QRNU_TABI_TABLEA = 1
> EVAL TableA(1..3) ** Specify the whole table **
TABLEA(1) = 'aaa'
TABLEA(2) = 'bbb'
TABLEA(3) = 'ccc'
> EVAL TableA=%INDEX(3) ** Change current index to 3 **
> EVAL TableA
TABLEA = 'ccc'