Listening for system events

The event notification facility (ENF) allows an authorized program to listen for the occurrence of a specific system event. For example, a program could use ENF to listen for a software record being written to the logrec data set. When the system writes the record to the logrec data set, control passes to a specified listener user exit routine. For a list of the system events that an authorized program can listen for, see ENF event codes and meanings.

To listen for a system event, use the ENFREQ macro with the LISTEN option to specify:
  • The specific event for which you would like to listen
  • The listener user exit routine that is to receive control after the specified event occurs
  • Address of an ENF Listener filter block (for signals that support filter blocks)
  • An optional DTOKEN to identify your listen request when ENF returns control
  • Any parameters that you would like to pass
  • Whether the listener user exit routine should end when the listener's task or address space ends
  • Whether you would like the listener user exit routine to run in the listener's address space (SRB mode).

In addition to issuing ENFREQ, you must also install your listener user exit routine in common storage if the listener user exit routine is not an SRB exit.

To stop listening for a system event, use ENFREQ with the DELETE option to specify:
  • The specific event for which your program was listening
  • The DTOKEN that you received on the original listen request.

The information describe how to establish a listen request and code a listener user exit routine. For the complete syntax of the ENFREQ macro, see z/OS MVS Programming: Authorized Assembler Services Reference EDT-IXG.