IBM AS/400 manual Specifying Error Indicators or the E, Extender

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 251
Image 251

This

section

provides

some

examples

of how to

use

each

of

these R

The ILE RPG

for AS/400

Referenceprovides

more information on the *PSSR and

INFSR error

subroutines, on

the EXSR

operation

code,

and

on

the INFDS

PSDS

data structures.

 

 

 

 

 

 

 

Specifying Error Indicators or the 'E'

Operation

Code

Extender

 

 

 

 

 

 

 

 

 

 

 

 

Operation codes that allow an error indicator also allow

the

'E'

opera

extender.

The

CALLP

operation

also allows the 'E' extender

although

it

allow an error indicator. This provides two ILE RPG error handling met

essentially

the

same.

 

Either

an error indicator or the 'E' extender

handle the

exception

for

the

same

operation

code,

not

both.

 

 

 

Note:

 

If

an

error

indicator

or

 

and

'E'

extender

 

is

 

coded

 

on

an

ope

 

 

error

which

 

occurs

is

not related to the operation (for examp

 

 

index

error

 

on

a

CHAIN

operation),

any

error

indicator

 

or

'E'

ex

 

 

be

ignored.

The

error

would be

treated

like

any

other

progra

To

enable

the

RPG

error

indicator

handler,

you

specify

an

 

error

ind

tions

73

and

74

for

the

operation

codes

listed

 

in

Table 15

 

on

page

CALLP). If an exception occurs on the operation, the

 

indicator

is

set

priate data structure (PSDS or INFDS) is updated, and control returns

sequential instruction. You can then test the

indicator

to

determine

take.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

To

enable

the

'E'

 

operation

code

extender

handler,

you

specify

an

'

any of the operation codes

in

 

Table 15 on

page 228.

Coding

 

the

'E'

e

affects the value returned by the built-in functions %ERROR and %STATU

exceptions. Before the operation begins, the value

returned

by

the

tions is set to zero. If

an exception occurs on the operation, th

these built-in functions are

updated accordingly, the appropriate dat

(PSDS

or

INFDS)

is

updated, and

control

returns to

the

next

sequential

You

 

can

then

use

these

built-in

functions

to

test

the

returned value

what

action

to

take.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Chapter 12. Handling Exceptions227

Page 251
Image 251
IBM AS/400 manual Specifying Error Indicators or the E, Extender