Setting event listeners

You can use the Event Listeners tab in the User Variables, Exits and Listeners preference page to define listeners that listen for specific types of events.

About this task

Using the Event Listeners tab, you can specify which listener you want to listen to each type of event, and the program to run when the event occurs.
Note:
  • The File Changed event is the only type of event that is supported in the Event Listeners tab.
  • When you set up your event listener, ensure that it does not trigger the same type of event that it is listening for. When you set up a file changed event listener, for example, do not allow the listener to trigger another file changed event. If the listener starts another file changed event, it might cause an endless loop in IBM® Developer for z/OS®.

Procedure

To specify event listeners, complete the following steps:

  1. In the User Variables, Exits and Listeners preference page, click the Event Listeners tab.
  2. In the File Changed group, complete the following steps:
    1. In the Event Listener field, type the location of the program that you want to run when the content of a file is changed, or to browse for the location of the program, click Browse.
      For example, specify C:\Program Files\myprogram.bat. You can specify the location of the program by using environment variables that are enclosed in percent signs (%), such as %TPFSHARE%.
    2. In the Arguments field, type the arguments that you want to send to the program.
      When you specify program arguments, you can use the following types of variables:
      Substitution variables
      To use substitution variables, click Variables to open the Substitution Variables window and select the substitution variables that you want to include in the variable string. The following variables are supported by the File Changed event:
      • &HOSTNAME
      • &RN_UNC
      • &RX_UNC
      • &R_UNC
      • &RN
      • &RX
      • &R
      • &N
      • &X
      • &DPN
      • &DPX
      • &DP
      • &P
      • &D
      • &T
      • &V
      • &VER
      • &EVENT_TYPE - resolves to 1
      Note: Some of these variables might not be resolved. If the file that is changed is a remote file, for example, the &DPN and &D variables are not resolved.
      User variables
      Enclose user variables with ampersands (&), such as &USR_MyVar&.
      Environment variables
      Enclose environment variables with percent signs (%), such as %ENVVAR%.
  3. To save your selections in the preference page, click Apply.
    The preferences that you selected can be used by any part of Developer for z/OS.