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