C Z-ADD5 DTALEN
C Z-ADD1 DATA#
C\
C\ For illustration purposes also dump the program object as
C\ part of logging the software error
C\
C MOVELPGMNAM OBJ1N .1/
C MOVELLIBNAM OBJ1L
C MOVEL'\PGM' OBJ1T
C Z-ADD1 OBJS#
C\
C\ Call the Log Software Error API
C\
C CALL 'QPDLOGER'
C PARM PGMNAM
C PARM EXCPID MSGID 12
C PARM MSGKEY 4
C PARM FAILPT
C PARM 'Y' JOBLOG 1
C PARM DATA
C PARM DATAPT
C PARM DATA#
C PARM OBJS
C PARM OBJS#
C PARM QUSBN
C\
C\ If an error on the API call, then indicate a terminal error
C\
C QUSBNC IFGT ð
C 'TERM ERR'DSPLY
C END
C ELSE
C\
C\ If error within \PSSR, then indicate \PSSR error
C\
C '\PSSR 'DSPLY
C END
C\
C\ No matter how the program got to the \PPSR, end the program
C\
C MOVE '1' \INLR
C RETRN
C ENDSR
Logging Software Error (OPM API without Pointers)—ILE RPG Example
Refer to “Logging Software Error (OPM API without Pointers)—ILE C Example” on
page 6-2 for the original example.
F\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
F\
F\ Program: Demonstrate use of OPM based Log Software Error
F\
F\ Language: ILE RPG
F\
F\ Description: This program performs a divide by ð operation to
F\ cause an exception. This exception is caught using
F\ RPG's \PSSR support, and the exception is then
Appendix B. Original Examples in Additional Languages B-119