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