IBM AS/400 manual Condition, Ceehdlr

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 265
Image 265

ILE

Condition

Handlers

 

requires a definition for the error-prone

array

ARR1,

and identific

eter lists used by the ILE bindable APIs

CEEHDLR

and

CEEHDLU.

The basic logic of the program is as follows:

 

1. Register

the

handler

RPGHDLR using the subroutine RegHndlr. This s

 

calls

the

CEEHDLR

 

API,

passing

it

the

procedure pointer

to RPGHDLR.

2. Indicate

 

to

RPGHDLR

that

the

out-of-bounds error is allowed, and

erate

an

 

out-of-bounds substring

error, then

set off the

indicato

RPGHDLR

will

not

allow

any unexpected out-of-bounds string

errors.

 

The handler RPGHDLR is automatically called. It handles the except

 

indicates that processing should resumesmachinetheinstrucnextion fol-

 

 

lowing

the

error.

Note

that

the

next

machine

instruction

may

not b

 

beginning

of

the

next

RPG operation.

 

 

 

 

3. Generate an out-of-bounds array error.

Again,

RPGHDLR is

automatically

called.

However, this time it cannot

the

exception,

and

so it percolates

it to the next exception ha

with

the procedure,

namely,

the *PSSR

error subroutine.

The *PSSR cancels the procedure.

4. Unregister the condition handler RPGHDLR via a call to CEEHDLU.

5. Return

As with the RPGHDLR procedure, SHOWERR writes to QSYSPRT to show what occurring as it is processed.

Chapter 12. Handling Exceptions241

Page 265
Image 265
IBM AS/400 manual Condition, Ceehdlr