Determining which exit type is invoking a common user exit

A user exit can be invoked by Z Abend Investigator options (Exits or DumpRegistrationExits) or by the HFZUTIL Exits control statement. The Z Abend Investigator options and the HFZUTIL control statement determine which user exit is invoked and under what conditions:

You can use a different REXX user exit or load module user exit for each user exit type, or you can use the same REXX user exit or load module user exit across different user exit types.

If you use the same REXX user exit or load module user exit across different user exit types, the user exit can check which exit type it's being invoked for.

For example, a single REXX user exit is specified as a normal Analysis Control user exit, an End Processing user exit, and a dump registration Analysis Control user exit using the options:

Exits(Control(REXX(myexit)),End(REXX(myexit)))
DumpRegistrationExits(Control(REXX(myexit)))
In this case, the user exit can include code like the following to check which exit type is calling the user exit:

If ENV.EXIT_CALL_TYPE = 'C' then do
  "ZAIWTO 'Normal Analysis Control user exit called'"
  /* Perform normal Analysis Control user exit processing... */
else if ENV.EXIT_CALL_TYPE = 'E' then do
  "ZAIWTO 'End Processing user exit called'"
  /* Perform End Processing user exit processing... */
else if ENV.EXIT_CALL_TYPE = 'X' then do
  "ZAIWTO 'Dump registration Analysis Control user exit called'"
  /* Perform dump registration Analysis Control user exit processing... */
else do
  "ZAIWTO 'User exit unexpectedly called'"
end