IBM Version 4 manual Exit-Point-Name, Format-Name, Qus-Ec

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 367
Image 367

\

\Remove an exit program from the exit point and then dereg￿ister

\the exit point. It is not necessary to remove exit programs

\from an exit point before deregistering the exit point. It is

\done here only for illustrative purposes.

\

\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 OF QUS-EC.

\

\Call the API to remove the exit program.

CALL PROCEDURE "QusRemoveExitProgram" USING

EXIT-POINT-NAME, FORMAT-NAME, PGM-NBR, 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-POINT, WRITE LIST-LINE FROM BAD-EXIT-POINT, STOP RUN.

\

\If the call to remove the exit program is successful,

\deregister the exit point.

\

\Call the API to deregister the exit point.

CALL PROCEDURE "QusDeregisterExitPoint" USING

EXIT-POINT-NAME, FORMAT-NAME, 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, WRITE LIST-LINE FROM BAD-EXIT-PGM, STOP RUN.

\

STOP RUN.

\

\End of MAINLINE

Appendix B. Original Examples in Additional BLanguages-89

Page 367
Image 367
IBM Version 4 manual Exit-Point-Name, Format-Name, Qus-Ec