MVS command to Add an Exit routine to an Exit

When you require to add an exit routine to an exit you may use the most simple form of the Add command:

/SETPROG EXIT,ADD,EXITNAME=exit_name,MODNAME=mod_name,DSNAME=dsname

Example:

exit_name = SYS.IEFACTRT

mod_name = IEFACTRT

dsname = SYS2.LINKLIB.TST1

/SETPROG EXIT,ADD,EXITNAME=SYS.IEFACTRT,MODNAME=IEFACTRT,DSNAME=SYS2.TST1.LINKLIB

Other parameters:

When adding an Exit routine to an Exit you may also have the need to use one or more of the following parameters:

STATE=active_inactive – Indicates the state of the exit routine. ACTIVE is the default value.

JOBNAME=jobname – The job(s) name(s) for which this exit routine is to get control. If some other job calls the exit, this exit routine does not get control. The default value is * which means all the jobs.

ABENDNUM=(n[,CONSEC]) – indicates that the exit routine is not to be given control after the n abends occur. CONSEC indicates that there must be n consecutive abends before the system stops giving control to the exit routine.

FIRST – Specifies that the system is to call the exit routine before all other exit routines associated with this exit, unless another exit routine, added after it, also specifies FIRST.

LAST – Specifies that the system is to call the exit routine after all other exit routines associated with this exit, unless other exit routines are added after it.

Examples:

/SETPROG EXIT,ADD,EX=SYS.IEFU83,MOD=CYN1FU83,DSN=CYN.SCYNAUTH,FIRST

/SETPROG EXIT,ADD,EX=SYS.IEFU83,MOD=CYN1FU83,DSN=CYN.SCYNAUTH,FIRST,STATE=INACTIVE

/SETPROG EXIT,ADD,EX=SYSSTC.IEFACTRT,MOD=IEFACTRT,ABENDNUM=(5)

/SETPROG EXIT,ADD,EX=SYSSTC.IEFACTRT,MOD=IEFACTRT,ABENDNUM=(5,CONSEC)