We are attempting to create a Phased GOA script to submit a job based on the utilization of two different pools. The two pools in the example script below are named XYZB2MN and XYZB2MX. We want the script to take action if XYZB2MN is greater than 10% used and if XYZB2MX is less than 40% used. On our test system both conditions are true. XYZB2MN is 18% used and XYZB2MX is 0% used. When we fire off this script it does not submit the job like we are expecting it to. Is it not possible to use AND logic in the SET FILTER statement?
<EVENT_PROCEDURE>
SELECT_OBJ=POOLS
SET_LASTINTVL
SET_FILTER=(POOLNAME=XYZB2M/)
APPLY_PHASEFILTER
EXECUTE
SET_STATE=OK
USE_MONITOR_OBJ
SET_FILTER=(POOLNAME INCL XYZB2MN AND POOLUPCT>10) AND
(POOLNAME INCL XYZB2MX AND POOLUPCT<40)
EXECUTE
SET_STATE=VIOLATION
SUBSTITUTE_JCL=DSN=SYS.JCL,MEMBER=DASDABX1
SUBMIT_PHASE_JOB
Vantage
The filter - as it is defined - will never select any record. This can be seen at a glance when we remove the parentheses from it - which are redundant in it - and rearrange the conditions:
POOLNAME INCL ABDB2MN AND POOLNAME INCL ABDB2MX AND POOLUPCT >10 AND POOLUPCT <40
It is clear that the first and second conditions are mutually exclusive and therefore cannot apply at the same time.
It is recommended to change the filter as follows:
SET_FILTER = (POOLNAME INCL ABDB2MN AND POOLUPCT >10) OR (POOLNAME INCL ABDB2MX AND POOLUPCT <40)
And continue the script:
EXECUTE
IF RECORDS EQ = 2
.....
One can also generate a script in this form using Automation Script Builder. After entering the filter - see above - just select "Equal to" in the "Conditions for Actions" step and enter 2 as the "number of records".