TO EXCEPTION-ID OF BAD-EXIT-PGM, 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—OPM RPG

Example

Refer

to “Retrieve

Exit Point and

Exit Program Information—ILE C Example

page 4-13 for the original example.

F\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

F\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

F\

F\

Program:

Retrieve Exit Point and Exit Program Information

F\

 

 

F\

Language:

OPM RPG

F\

 

 

F\

Description:

This program retrieves exit point and exit

F\

 

program information. After retrieving the

F\

 

exit point information, the program calls each

F\

 

exit program.

F\

 

 

F\

APIs Used:

QUSRTVEI - Retrieve Exit Information

F\

 

 

 

 

Appendix B. Original Examples in Additional BLanguages-71

Page 349
Image 349
IBM Version 4 manual Appendix B. Original Examples in Additional BLanguages