IBM AS/400 manual Displaying Data Structures, Stepping Through the Program Object

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 227
Image 227
Displaying Data Structures

Stepping Through the Program Object

3DIM(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'

Figure 99. Sample EVAL commands for a Table

Displaying Data Structures

You display the contents of a data structure or its subfields as standalone field. You simply use the data structure name after EVAL entire contents, or the subfield name to see a subset.

When displaying a multiple-occurrence data structure, an EVAL on the d ture name will show the subfields using the current index. To specif occurrence, specify the index in parentheses following the data stru example, to display the contents of the second occurrence of DS1,

EVAL DS1(2)

Similarly, to view the contents of a particular occurrence of a subf notation.

To determine the value of the current index, enter the following com

EVAL _QRNU_DSI_name

wherename represents the data structure name in question.

If a subfield is defined as an of the overlay subfield, you can occurrence, and the index notation

An alternative way of displaying a following notation:

EVAL subfield-name(occurrence-index,array-index)

array overlay of another subfield use the %INDEX built-in function to to specify the array.

subfield which is an array overla

where the variablesubfield-nameis the name of the subfield you wish to

occurrence-indexis the

number of the array occurrencearrayto-indexdisplay, an

is the number of

the

element to

display.

Figure 100

on page

204

shows some

examples of using EVAL with the the

structures

defined in

DBGEX.

 

Chapter 11. Debugging Programs203

Page 227
Image 227
IBM AS/400 manual Displaying Data Structures, Stepping Through the Program Object