IBM Version 4 manual EXIT-POINT-NAME of MISC, FORMAT-NAME of MISC, VARREC, QUS-EC

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 331
Image 331

MOVE 8 TO CONTROL-KEY OF QUS-VLEN-REC-4. MOVE 5ð TO LENGTH-DATA OF QUS-VLEN-REC-4.

MOVE "EXIT POINT EXAMPLE"

TO VAR-RECORDS((VAR-OFFSET + 12):5ð).

PERFORM CALCULATE-NEXT-OFFSET.

\

\Call the API to add the exit point.

CALL PROCEDURE "QusRegisterExitPoint" USING

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

\

\If the call to register an exit point is successful, add

\an exit program to the exit point.

\

\Set the total number of exit program attributes that are ￿being

\specified on the call. This program lets the API take the

\default for the attributes that are not specified. Each

\attribute record must be 4-byte aligned.

\

MOVE 2 TO NBR-RECORDS. MOVE 1 TO VAR-OFFSET.

\

 

 

 

\ Set the values

for the

two attributes that are being spec￿ified:

\

Replace exit

program

= 1

\Exit program data CCSID = 37

MOVE 4 TO CONTROL-KEY OF QUS-VLEN-REC-4. MOVE 1 TO LENGTH-DATA OF QUS-VLEN-REC-4. MOVE 1 TO VAR-RECORDS((VAR-OFFSET + 12):1).

PERFORM CALCULATE-NEXT-OFFSET.

MOVE 3 TO CONTROL-KEY OF QUS-VLEN-REC-4. MOVE 4 TO LENGTH-DATA OF QUS-VLEN-REC-4.

MOVE 37 TO BINARY-NUMBER.

MOVE BINARY-CHAR TO VAR-RECORDS((VAR-OFFSET + 12):4).

PERFORM CALCULATE-NEXT-OFFSET.

\Call the API to register the exit program.

\

CALL PROCEDURE "QusAddExitProgram" USING EXIT-POINT-NAME OF MISC, FORMAT-NAME OF MISC, EXIT-PGM-NBR OF MISC, EXIT-PGM OF MISC, EXIT-PGM-DATA OF MISC,

Appendix B. Original Examples in Additional BLanguages-53

Page 331
Image 331
IBM Version 4 manual EXIT-POINT-NAME of MISC, FORMAT-NAME of MISC, VARREC, QUS-EC