IBM AS/400 manual RPGHDLR RPG exception handling procedure

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 263
Image 263

 

 

 

 

ILE

Condition Handlers

pointer to

a

communication area

between SHOWERR and RPGHDLR, and a f

to

contain

the

possible actions,

resume or

percolate. (RPGHDLR does n

any

exceptions).

 

 

The basic logic of RPGHDLR is the following:

1. Test to see if it is an out-of-bounds error by testing the mes

¹If it is, and if SHOWERR has indicated that out-of-bounds err ignored, it writes 'Handling...' to QSYSPRT and then sets the ac

'Resume'.

¹ Otheriwse,

it

writes

out 'Percolating' to QSYSPRT,

and then sets

to 'Percolate'.

 

 

 

 

 

2. Return.

 

 

 

 

 

 

 

 

 

*=================================================================*

 

* RPGHDLR: RPG exception handling procedure.

*

 

*

 

 

This procedure does the following:

*

 

*

 

 

Handles the exception if it is the RPG

*

 

*

 

 

 

out of bounds error (RNX0100)

*

 

*

 

 

otherwise

 

 

*

 

*

 

 

 

percolates the exception

*

 

*

 

 

It also prints out what it has done.

*

 

*

 

 

 

 

 

 

 

*

 

* Note:

 

This is the exception handling procedure for the

*

 

*

 

 

SHOWERR procedure.

 

*

 

*=================================================================*

 

FQSYSPRT

O

 

F 132

 

PRINTER

 

 

D RPGHDLR

 

PR

 

 

 

 

 

D

Parm1

 

 

 

 

 

LIKE(CondTok)

 

 

D

Parm2

 

 

 

 

 

*

 

 

D

Parm3

 

 

 

 

 

10I 0

 

 

D

Parm4

 

 

 

 

 

LIKE(CondTok)

 

 

*

-----------------------------------------------------------------

 

 

 

 

 

*

 

* Procedure parameters

 

 

*

 

* 1. Input: Condition token structure

*

 

* 2. Input: Pointer to communication area containing

*

 

*

 

a. A pointer to the PSDS of the procedure being handled

*

 

*

 

b. An indicator telling whether a string error is valid

*

 

* 3. Output: Code identifying actions to be performed on the￿

*

 

*

 

 

exception

 

 

*

 

* 4. Output: New condition if we decide to promote the

*

 

*

 

 

condition.

Since this handler only resumes and

*

 

*

 

 

percolates, we will ignore this parameter.

*

 

*

-----------------------------------------------------------------

 

 

 

 

 

*

 

D RPGHDLR

 

PI

 

 

 

 

 

D

InCondTok

 

 

 

 

LIKE(CondTok)

 

 

D

pCommArea

 

 

 

 

*

 

 

D

Action

 

 

 

 

10I 0

 

 

D

OutCondTok

 

 

 

LIKE(CondTok)

 

 

 

 

 

 

 

 

 

 

Figure

116

(Part

1

of

2).

Source for Condition Handler for Out-of-Bounds Substring Er

Chapter 12. Handling Exceptions239

Page 263
Image 263
IBM AS/400 manual RPGHDLR RPG exception handling procedure