Scenario: Using the watch for event function with an exit program

This scenario explains how to use the watch for event function with an exit program.

Assume that you have a MYCLNUP program that you run whenever you want to clear the storage space on your system. You usually run this program when message CPF0907 (Serious storage condition might exist) is sent to the history log (QHST message queue in library QSYS).

You use the watch for event function to automatically run your cleanup program when the amount of available storage in the system auxiliary storage pool has reached the threshold value. Your user exit program also performs some special actions when the available storage is less than 5%.

When message CPF0907 enters the specified message queue, follow these steps to run MYCLNUP: