Dᑍ
Dᑍ Miscellaneous data
Dᑍ
DVARREC DS
D NBR_RECS 9B
D RECS 1
DV_OFFSET S 9 INZ(1)
Dᑍ
DOVERLAYS DS
D BINARY 9B
D BINARY_C 4 OVERLAY(BINARY)
Dᑍ
DEPNTNAME S 2 INZ('EXAMPLE_EXIT_POINT')
DEPGM S 2 INZ('EXAMPLEPGMEXAMPLELIB')
DEPGMDTA S 25 INZ('EXAMPLE EXIT PROGRAM DATA')
DEPGMDTA_SZ S 9B INZ(%SIZE(EPGMDTA))
Cᑍ
Cᑍ Beginning of mainline
Cᑍ
Cᑍ Register the exit point with the registration facility. If the
Cᑍ registration of the exit point is successful, add an exit
Cᑍ program to the exit point.
Cᑍ
Cᑍ Initialize the error code parameter. To signal exceptions to
Cᑍ this program by the API, you need to set the bytes provided
Cᑍ field of the error code to zero. Because this program has
Cᑍ exceptions sent back through the error code parameter, it sets
Cᑍ the bytes provided field to the number of bytes it gives the
Cᑍ API for the parameter.
Cᑍ
C EVAL QUSBPRV = %SIZE(QUSEC)
Cᑍ
Cᑍ Set the exit point controls. Each control field is passed to
Cᑍ the API using a variable length record. Each record must
Cᑍ start on a 4-byte boundary.
Cᑍ
Cᑍ Set the total number of controls that are being specified on
Cᑍ the call. This program lets the API take the default for the
Cᑍ controls that are not specified.
Cᑍ
C EVAL NBR_RECS = 2
Cᑍ
Cᑍ Set the values for the two controls that are specified:
Cᑍ Maximum number of exit programs = 1
Cᑍ Exit point description = 'EXIT POINT EXAMPLE'
Cᑍ
C EVAL QUSCK = 3
C EVAL QUSLD = 4
C EVAL BINARY = 1
C EVAL %SUBST(RECS:V_OFFSET+12) = BINARY_C
C EXSR CALC_VOFF
C EVAL QUSCK = 8
C EVAL QUSLD = 5
C EVAL %SUBST(RECS:V_OFFSET+12:5) = 'EXIT +
C POINT EXAMPLE'
C EXSR CALC_VOFF
Cᑍ
Cᑍ Call the API to register the exit point.
Appendix B. Original Examples in Additional Languages B-59