Start of change

Exit program to end query

This Query Supervisor exit program shows how to request that the query that was running when the threshold was reached is to be stopped.

When this exit program is called, it instructs the Query Supervisor to end the query if it is called for either:
  1. An ELAPSED TIME threshold when the threshold consumption has reached at least 60 minutes
  2. A threshold with a name that starts with the letters TERMINATE
The threshold definitions used by the C and ILE RPG sample programs are:
CALL QSYS2.ADD_QUERY_THRESHOLD(THRESHOLD_NAME=>'One hour limit',
                               THRESHOLD_TYPE=>'ELAPSED TIME',
                               THRESHOLD_VALUE=>'3600');
CALL QSYS2.ADD_QUERY_THRESHOLD(THRESHOLD_NAME=>'TERMINATE FOR STORAGE',
                               THRESHOLD_TYPE=>'TEMPORARY STORAGE',
                               THRESHOLD_VALUE=>'500');            
End of change