Associating an exit routine with an exit

You associate an exit routine with an exit using the CSVDYNEX ADD request. If the exit routine is not in the LPA list or in the nucleus, and you did not use the MODADDR keyword, the system loads the exit routine into common storage.

It is important that the exit associator know the exit criteria established by the exit definer. To find out the exit criteria, check the requirements imposed by the exit definer (the system, for SMF and allocation exits; or a vendor or customer application).

When you use the ADD request, you tell the system the name of the exit with which you are associating the exit routine. You also tell the system where to find the exit routine code. Other important questions you need to ask are:
  • Do you want the exit routine to be called only if a certain address space is primary (STOKEN parameter), or if a certain job (JOBNAME parameter) is running?

    You can change the STOKEN or JOBNAME specification through the MODIFY request.

  • Do you want the exit routine to be called even if on previous calls it has abnormally ended?

    The ADDABENDNUM and ABENDCONSEC parameters on the ADD request are similar to the ABENDNUM and ABENDCONSEC parameters on the DEFINE request. On the ADD request, you can override the settings that were defined on the DEFINE request.

The following scenario shows the associating of an exit routine named RTN1 with an exit named EX1.
exit associator code
 __________
 __________

CSVDYNEX REQUEST=ADD,MODNAME==CL8'RTN1',
           EXITNAME==CL16'EX1'...
 __________

You can associate an exit routine with an exit that does not exist (perhaps because it has not been defined yet). In this case, the system maintains the association; however, the exit routine does not get control until the exit is defined and the CALL is issued.

You can change two of the parameter specifications of the ADD request. Through the MODIFY request, you can:
  • Change the state of an exit routine from active to inactive, or vice versa
  • Change the requirement that the exit routine runs while a specific job runs or while a certain address space is the primary address space.
Example of associating an exit routine with an installation exit: Although you might use the system command SETPROG to associate an exit routine with an installation exit, you can also accomplish this action through a program. The following example shows how you would associate the routine named MYMOD with the SMF installation exit known as IEFUJI, defined through the SYS statement in SMFPRMxx parmlib member. The load module is in data set MY.DSN.
         CSVDYNEX REQUEST=ADD,EXITNAME=LEX,
               MODNAME=LMOD,STATE=ACTIVE,DSNAME=LDSN,
               RETCODE=LRETCODE,RSNCODE=LRSNCODE,MF=(E,DYNEXL)
*
* Place code to check return/reason codes here
⋮
⋮
* Data Declarations
LEX      DC    CL16'SYS.IEFUJI'
LMOD     DC    CL8'MYMOD'
LDSN     DC    CL44'MY.DSN'
         CSVEXRET              Return code information
DYNAREA  DSECT
LRETCODE DS    F
LRSNCODE DS    F
         CSVDYNEX MF=(L,DYNEXL)