WRITE LIST-LINE FROM BAD-EXIT-PGM, STOP RUN.

\

\If the call to retrieve exit program information is succe￿ssful,

\check to see if there are any exit programs to call.

\

\The receiver variable offers enough room for a minimum of￿ one

\exit program entry because the receiver variable was dec￿lared

\as 35ðð bytes. Therefore, this example only checks the

\number of exit programs returned field. If the receiver

\variable were not large enough to hold at least one entry￿,

\the bytes available field would need to be checked as wel￿l as

\the number of exit programs returned field. If the number of

\exit programs returned field is set to zero and the bytes￿

\available field is greater than the bytes returned field￿, the

\API had at least one exit program entry to return but was

\unable to because the receiver variable was too small.

\

SET ADDRESS OF QUS-EXTIð2ðð-ENTRY

TO ADDRESS OF RCVVAR(OFFSET-PROGRAM-ENTRY

OF QUS-EXTIð2ðð + 1:).

PERFORM CALL-PGMS

NUMBER-PROGRAMS-RETURNED OF QUS-EXTIð2ðð TIMES.

\

CALL-PGMS.

\

\Call the exit program while ignoring failures on the call￿

CALL PROGRAM-NAME OF QUS-EXTIð2ðð-ENTRY USING

EXIT-PARAMETERS

ON EXCEPTION CONTINUE.

\

\Address the next exit program entry

SET ADDRESS OF QUS-EXTIð2ðð-ENTRY

TO ADDRESS OF RCVVAR(OFFSET-NEXT-ENTRY

OF QUS-EXTIð2ðð-ENTRY + 1:).

Retrieve Exit Point and Exit Program Information—ILE COBOL

Example

Refer to “Retrieve Exit Point and Exit Program Information—ILE C Example” page 4-13 for the original example.

IDENTIFICATION DIVISION.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\

\ Program: Retrieve Exit Point and Exit Program Information

\

\Language: ILE COBOL

\Description: This program retrieves exit point and exit

\

program information. After

retrieving the

\

exit

point information, the

program calls each

\

exit

program.

 

\

 

 

 

\APIs Used: QUSCRTUS - Create User Space

B-66System API Programming V4R1

Page 344
Image 344
IBM Version 4 Write LIST-LINE from BAD-EXIT-PGM, Stop RUN, To Address of RCVVAROFFSET-PROGRAM-ENTRY, Perform CALL-PGMS