SET ADDRESS OF QUS-EXTIð2ðð TO BASE-POINTER.

\

IF NUMBER-POINTS-RETURNED OF QUS-EXTIð1ðð > ð SET ADDRESS OF QUS-EXTIð1ðð-ENTRY TO

ADDRESS OF RCVVAR((OFFSET-EXIT-POINT-ENTRY OF QUS-EXTIð1ðð + 1):)

ELSE STOP RUN.

\

IF NUMBER-EXIT-PROGRAMS OF QUS-EXTIð1ðð-ENTRY > ð

\

\There are some exit programs to call. Blank out the continuation

\handle to let the API know that this is a first attempt at t￿he

\retrieve operation.

\

MOVE SPACES TO CONTINUATION-HDL,

\

\Call the exit programs

PERFORM CALL-EXIT-PROGRAMS,

\If the continuation handle field in the receiver variabl￿e is

\not set to blanks, the API has more information to return t￿han

\what could fit in the receiver variable. Call the API for

\more exit programs to call.

\

PERFORM UNTIL CONTINUE-HANDLE OF QUS-EXTIð2ðð = SPACES MOVE CONTINUE-HANDLE OF QUS-EXTIð2ðð

TO CONTINUATION-HDL,

PERFORM CALL-EXIT-PROGRAMS, END-PERFORM.

\

STOP RUN.

\

\End of MAINLINE

\Process exit programs in receiver variable

CALL-EXIT-PROGRAMS.

\Call the API to retrieve the exit program information

CALL "QUSRTVEI" USING CONTINUATION-HDL, RCVVAR, BY CONTENT LENGTH OF RCVVAR, FORMAT-NAME-1,

EXIT-POINT-NAME OF MISC, FORMAT-NAME-2, EXIT-PGM-NBR, NBR-OF-SELECT-CRITERIA, QUS-EC.

\

\If an exception occurs, the API returns the exception in t￿he

\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 > ð

OPEN OUTPUT LISTING,

MOVE EXCEPTION-ID OF QUS-EC

TO EXCEPTION-ID OF BAD-EXIT-PGM,

Appendix B. Original Examples in Additional BLanguages-65

Page 343
Image 343
IBM Version 4 manual Else Stop RUN, Perform CALL-EXIT-PROGRAMS, To CONTINUATION-HDL, Call-Exit-Programs