Deleting an exit routine from an exit

When the exit routine is no longer needed, the exit provider should use the DELETE request to remove the association between the exit and the exit routine. At a DELETE request, the system generally frees the storage that contained the exit routine once it determines that the exit routine is not in use. The following rules describe the system's freeing of storage:
  • It does not free storage:
    • When the exit routine originally resided in the LPA list or in the nucleus.
    • When the exit routine was associated with the exit (the ADD request) using the MODADDR parameter.
    • When the exit has FASTPATH processing and the DEFINE request includes FORCE=NO (the default), and the exit definer specified PSW key 8 to 15.
  • It frees the storage immediately, without checking to see if the exit routine is in use:
    • When the DELETE request is for a FASTPATH exit, the exit definer specified PSW key 8 to 15, and the DELETE request specifies FORCE=YES. (In this case, the issuer of the DELETE request must determine whether the exit routine is in use.)
  • In all other cases, it frees the storage after it determines that the exit routine is not in use.

As you decide whether you need to free the storage, consider the effects of address space termination. If the exit routine resides in the private area of an address space (this can only happen if you use the MODADDR keyword), make sure that you use either the JOBNAME or STOKEN parameter, and that the exit itself is not called after the address space terminates. If you don't limit the use of the exit routine, the system could end up trying to call the exit routine after its storage no longer exists due to the termination of the job or address space.