IBM AS/400 Frozen Dessert Maker User Manual


 
ILE Condition Handlers
| pointer to a communication area between SHOWERR and RPGHDLR, and a field
to contain the possible actions, resume or percolate. (RPGHDLR does not promote
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 message ID
| If it is, and if SHOWERR has indicated that out-of-bounds errors maybe
| ignored, it writes 'Handling...' to QSYSPRT and then sets the action to
'Resume'.
| Otheriwse, it writes out 'Percolating' to QSYSPRT, and then sets the action
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 Error
Chapter 12. Handling Exceptions 239