ᑍ the API using a variable length record. Each record must
ᑍ start on a 4-byte boundary.
ᑍ
ᑍ Set the total number of controls that are being specified on
ᑍ the call. This program lets the API take the default for the
ᑍ controls that are not specified.
ᑍ
MOVE 2 TO NBR-RECORDS.
ᑍ
ᑍ Set the values for the two controls that are specified:
ᑍ Maximum number of exit programs = 1
ᑍ Exit point description = 'EXIT POINT EXAMPLE'
ᑍ
MOVE 3 TO CONTROL-KEY OF QUS-VLEN-REC-4.
MOVE 4 TO LENGTH-DATA OF QUS-VLEN-REC-4.
MOVE 1 TO BINARY-NUMBER.
MOVE BINARY-CHAR TO VAR-RECORDS((VAR-OFFSET + 12):4).
PERFORM CALCULATE-NEXT-OFFSET.
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.
Cᑍ
Cᑍ Call the API to add the exit point.
Cᑍ
CALL "QUSRGPT" USING EXIT-POINT-NAME OF MISC,
FORMAT-NAME OF MISC,
VARREC, QUS-EC.
Cᑍ
Cᑍ If an exception occurs, the API returns the exception in the
Cᑍ error code parameter. The bytes available field is set to
Cᑍ zero if no exception occurs and greater than zero if an
Cᑍ exception does occur.
Cᑍ
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.
Appendix B. Original Examples in Additional Languages B-49