\exception data for the error, the developer should physic￿ally

\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

LOG-EXCEPTION-ID PIC

X(12).

 

 

 

ð5

MESSAGE-KEY

PIC

X(ð4).

 

 

ð5

POINT-OF-FAILURE PIC

S9(ð9)

BINARY VALUE 1.

 

 

ð5

PRINT-JOBLOG

PIC

X(ð1)

VALUE "Y".

 

 

ð5

NBR-OF-ENTRIES

PIC

S9(ð9)

BINARY.

 

 

ð5

NBR-OF-OBJECTS

PIC

S9(ð9)

BINARY VALUE 1.

 

ð1

MESSAGE-INFO.

 

 

 

 

 

ð5

MSG-OFFSET

PIC

S9(ð9)

BINARY.

 

 

ð5

MSG-LENGTH

PIC

S9(ð9)

BINARY.

 

ð1

OBJECT-LIST.

 

 

 

 

 

ð5

OBJECT-NAME

PIC

X(3ð).

 

 

ð5

LIBRARY-NAME

PIC

X(3ð).

 

 

ð5

OBJECT-TYPE

PIC

X(1ð)

VALUE "\PGM

".

LINKAGE

SECTION.

 

 

 

 

ð1 CBL-EXCEPTION-ID

PIC

X(ð7).

 

ð1

VALID-RESPONSES

PIC

X(ð6).

 

ð1 PGM-IN-ERROR.

 

 

 

 

 

ð5

PGM-NAME

PIC

X(1ð).

 

 

ð5

LIB-NAME

PIC

X(1ð).

 

ð1 SYS-EXCEPTION-ID

PIC

X(ð7).

 

ð1

MESSAGE-TEXT

PIC

X(ð1).

 

ð1

MESSAGE-LENGTH

PIC

S9(ð9)

BINARY.

 

ð1

SYS-OPTION

PIC

X(ð1).

 

\

\Beginning of mainline

PROCEDURE DIVISION USING CBL-EXCEPTION-ID,

VALID-RESPONSES, PGM-IN-ERROR, SYS-EXCEPTION-ID, MESSAGE-TEXT, MESSAGE-LENGTH, SYS-OPTION.

MAIN-LINE.

\

\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 t￿he

\API for the parameter.

\

MOVE 16 TO BYTES-PROVIDED.

\

\Record the COBOL Exception id

MOVE SYS-EXCEPTION-ID TO LOG-EXCEPTION-ID.

\Record the length of the message replacement data (if any￿)

Appendix B. Original Examples in Additional BLanguages-115

Page 393
Image 393
IBM Version 4 Misc LOG-EXCEPTION-ID PIC, Message-Key Pic, Point-Of-Failure Pic, Binary Value PRINT-JOBLOG PIC, Value \PGM