PRIOR-ERROR-HANDLER OF MISC,
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 OF QUS-EC >
DISPLAY "Error setting handler",
STOP RUN.
ᑍ
ᑍ If the call to register an error handler is successful, then
ᑍ cause a the data decimal error (X is initialized to blanks).
ᑍ
ADD X TO Y.
ᑍ
ᑍ Should not get here due to data decimal error
ᑍ
STOP RUN.
ᑍ
ᑍ End of MAINLINE
ᑍ
ERRHDL1 Program
IDENTIFICATION DIVISION.
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍ
ᑍ Program: Log a software error
ᑍ
ᑍ Language: COBOL
ᑍ
ᑍ Description: This program receives control for exceptions
ᑍ within a COBOL run unit. This program is used
ᑍ in conjunction with CBLERR1. ,
ᑍ Any exception causes this error handler to be
ᑍ called which then logs the software error.
ᑍ
ᑍ APIs Used: QPDLOGER - Log Software Error
ᑍ
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍ
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
PROGRAM-ID. ERRHDL1.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-AS4.
OBJECT-COMPUTER. IBM-AS4.
INPUT-OUTPUT SECTION.
DATA DIVISION.
WORKING-STORAGE SECTION.
ᑍ
ᑍ Error Code parameter include. As this sample program
ᑍ uses COPY to include the error code structure, only the first
ᑍ 16 bytes of the error code structure are available. If the
ᑍ application program needs to access the variable length
B-114 System API Programming V4R1