IBM AS/400 Data, Displaying Variable-Length Fields, by Pointers, Displaying Null-Capable Fields

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 230
Image 230

Stepping Through the Program Object

Displaying

UCS-2

Data

 

 

 

 

 

 

 

The

value

displayed

for

UCS-2

fields has

been

translated

into

readab

For

example,

if a UCS-2 field

has been

set to

%UCS2('abcde'),

then t

played for

that field would

be 'abcde'. You can display

UCS-2 data

using

the

:u

suffix

for

EVAL.

 

 

 

 

 

Displaying Variable-Length Fields

 

 

 

 

 

 

 

 

 

 

 

 

When you use EVAL fldname for

a

variable

length

field,

only the

data

field is shown. When you use

any

suffix

such

 

as

:c

or

:x

for

the

including the length is shown.

To

determine

the

current

length

of

a

va

field, use EVAL fldname:x. The

length is the first four

hexadecimal

d

format.

You must

convert this

value

to decimal

form

to

get

the length;

if the

result is

003DF1F2...,

the

length

is 003D

which

is

(3

*

16)

+

Displaying Data

Addressed

by Pointers

If

you

want

to see

what

a pointer is pointing to, you can use the

with

the

:c

or :x suffix. For example, if pointer field PTR1 is poin

character

data,

 

 

EVAL PTR1:c 10

 

 

 

will

show

the

contents

of

those 10 bytes.

You can also show the contents in hexadecimal using:

EVAL PTR1:x 10

This would be especially useful when the data that the pointer addre stored in printable form, such as packed or binary data.

Displaying Null-Capable Fields

You

can

use

the

EVAL debug command to display the null indicator

of

a

capable field. The null indicator

is

an internal

variable

(similar

to

th

for multiple-occurrence DS) which is named _QRNU_NULL_fieldname. The

 

 

fieldname can be

the

name

of

an

array

if the

array

is

null-capable.

When the debugger displays a

null-capable field, the content

of

the

 

played

regardless

 

of

whether

the

field

is

considered

null.

For

exampl

FLD1

is

null-capable,

and

is

currently

null.

Then

the result

of

EVAL

 

 

_QRNU_NULL_FLD1 is

 

'1'

 

and

EVAL

FLD1

shows

the

current content

of

FLD1,

even

though

its null

indicator

is on.

 

 

 

 

 

 

 

 

 

EVAL _QRNU_NULL_FLD1

Result:

_QRNU_NULL_FLD1 = '1'

 

 

 

 

 

 

 

 

EVAL FLD1

 

 

Result:

FLD1 = 'abcde'

 

 

 

 

 

 

 

 

 

Using

Debug Built-In Functions

 

 

 

 

The

following built-in

functions are

available

while

using the ILE source

%SUBSTR

 

 

 

 

 

 

 

Substring a

string

field.

 

 

 

%ADDR

Retrieve the address of a field.

 

 

%INDEX

Change the index of a table or multiple-occurrence data struct

%VARS

Identifies

the

specified

parameter

as

a variable.

206 ILE RPG for AS/400 Programmer's Guide

Page 230
Image 230
IBM AS/400 manual Displaying Variable-Length Fields, by Pointers, Displaying Null-Capable Fields, Displaying Data