IBM AS/400 Frozen Dessert Maker User Manual


 
ILE Condition Handlers
requires a definition for the error-prone array ARR1, and identification of the param-
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 subroutine
calls the CEEHDLR API, passing it the procedure pointer to RPGHDLR.
| 2. Indicate to RPGHDLR that the out-of-bounds error is allowed, and then gen-
| erate an out-of-bounds substring error, then set off the indicator so that
| RPGHDLR will not allow any unexpected out-of-bounds string errors.
The handler RPGHDLR is automatically called. It handles the exception, and
indicates that processing should resumes in the next
machine
instruction fol-
lowing the error. Note that the next machine instruction may not be at the
beginning of the next RPG operation.
3. Generate an out-of-bounds array error.
Again, RPGHDLR is automatically called. However, this time it cannot handle
the exception, and so it percolates it to the next exception handler associated
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 is
occurring as it is processed.
Chapter 12. Handling Exceptions 241