IBM Version 4 Universal Remote User Manual


 
ᑍ For illustration purposes, dump the program object
MOVE 32 TO KEY-FIELD OF QPD-NAMED-SYSTEM-OBJECT.
MOVE PGM-NAME OF PGM-IN-ERROR
TO OBJECT-NAME OF QPD-NAMED-SYSTEM-OBJECT.
MOVE LIB-NAME OF PGM-IN-ERROR
TO OBJECT-LIBRARY OF QPD-NAMED-SYSTEM-OBJECT.
MOVE "ᑍPGM" TO OBJECT-TYPE OF QPD-NAMED-SYSTEM-OBJECT.
ADD 1 TO NBR-OF-RECORDS.
SET PROBLEM-POINTER (NBR-OF-RECORDS) TO
ADDRESS OF QPD-NAMED-SYSTEM-OBJECT.
ᑍ Call the API to log the software error.
CALL "QpdReportSoftwareError" USING PROBLEM-RECORDS,
NBR-OF-RECORDS,
QUS-EC.
ᑍ If an exception occurs, the API returns the exception in the
ᑍ error code parameter. The bytes available field is set to
ᑍ zero if no exception occurs and greater than zero if an
ᑍ exception does occur.
IF BYTES-AVAILABLE >  DISPLAY "Cannot log error".
ᑍ End the current run unit
MOVE "C" TO SYS-OPTION.
STOP RUN.
ᑍ End of MAINLINE
Reporting Software Error (ILE API with Pointers)—ILE RPG Example
Refer to “Reporting Software Error (ILE API with Pointers)—ILE C Example” on
page 6-7 for the original example.
Fᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
F
Fᑍ Program: Demonstrate use of ILE-based Report 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ᑍ RPGs ᑍPSSR support, and the exception is then logged
Fᑍ as a software error.
F
Fᑍ APIs used: QpdReportSoftwareError
F
Fᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
D
Dᑍ Include Error Code Parameter
D
D/COPY QSYSINC/QRPGLESRC,QUSEC
D
B-126 System API Programming V4R1