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 the
ᑍ 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 specified:
ᑍ 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 Languages B-53