IBM AS/400 Handler definitions, If this is CPF4906, handle the notify msg, otherwise percolate

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 272
Image 272
* Handler definitions

If you encounter this problem, you have two possible ways to avoid i

1.Ensure that the caller is in a different activation group from the dure.

2.Enable an ILE condition handler in the RPG procedure. In the handle message is one that you want to ignore, indicate that the message handled. Otherwise, indicate that it should be percolated.

You could

also

make

this

handler

more

generic,

and have it

ignore a

sages with

a severity

of

0

(information) and

1 (warning).

 

Figure 120

shows

an

example

of

a

ILE

condition

handler that

ignores

CPF4906.

 

 

 

 

 

 

 

 

 

 

*----------------------------------------------------------------

* Handler definitions

*----------------------------------------------------------------

D Action

S

10I

0

D Token

DS

 

 

D

MsgSev

 

5I

0

D

MsgNo

 

2A

 

D

 

 

1A

 

D

Prefix

 

3A

 

D

 

 

4A

 

 

*----------------------------------------------------------------

 

 

 

* Actions

 

 

 

 

*----------------------------------------------------------------

 

 

D Handle

C

 

10

D Percolate

C

 

20

 

*----------------------------------------------------------------

 

 

 

* Severities

 

 

 

 

*----------------------------------------------------------------

 

 

D Info

C

 

0

D Warning

C

 

1

D Error

C

 

2

D Severe

C

 

3

D Critical

C

 

4

C

*ENTRY

PLIST

 

 

C

 

PARM

Token

 

C

 

PARM

dummy

1

C

 

PARM

Action

 

 

*----------------------------------------------------------------

 

 

*If this is CPF4906, handle the notify msg, otherwise perco￿late *----------------------------------------------------------------

C

IF

Prefix = 'CPF' AND

C

 

MsgNo = X'4906'

C

EVAL

Action = Handle

C

ELSE

 

C

EVAL

Action = Percolate

C

ENDIF

 

C

RETURN

 

Figure

120. ILE Condition Handler that Ignores CPF4906

Figure 121

on page 249 shows

how

you would code the calculations if

wanted to

ignore

all

status

and

notify messages. Escape messages and

tion

checks

have

a

severity

of

2 (Error) or higher.

248 ILE RPG for AS/400 Programmer's Guide

Page 272
Image 272
IBM AS/400 manual Handler definitions, If this is CPF4906, handle the notify msg, otherwise percolate