IBM Version 4 Universal Remote User Manual


 
APIs Used: QLRSETCE - Set COBOL Error Handler
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
PROGRAM-ID. CBLERR1.
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
ᑍ exception data for the error, the developer should physically
ᑍ copy the QSYSINC include and modify the copied include to
ᑍ define additional storage for the exception data.
COPY QUSEC OF QSYSINC-QLBLSRC.
ᑍ Miscellaneous elements
1 MISC.
5 Y PIC S9(9) VALUE .
5 ERROR-HANDLER PIC X(2) VALUE "ERRHDL1 ᑍLIBL ".
5 SCOPE PIC X(1) VALUE "C".
5 ERROR-HANDLER-LIBRARY PIC X(1).
5 PRIOR-ERROR-HANDLER PIC X(2).
1 NUMERIC-GROUP.
5 X PIC 9(3).
ᑍ Beginning of mainline
PROCEDURE DIVISION.
MAIN-LINE.
ᑍ Register the COBOL Error Handler.
ᑍ Initialize the error code parameter. To signal exceptions to
ᑍ this program by the API, you need to set the bytes provided
ᑍ field of the error code to zero. Because this program has
ᑍ exceptions sent back through the error code parameter, it sets
ᑍ the bytes provided field to the number of bytes it gives the
ᑍ API for the parameter.
MOVE 16 TO BYTES-PROVIDED.
ᑍ Call the API to register the exit point.
CALL "QLRSETCE" USING ERROR-HANDLER OF MISC,
SCOPE OF MISC,
ERROR-HANDLER-LIBRARY OF MISC,
Appendix B. Original Examples in Additional Languages B-113