We have an event based job which runs every 3 hours. Recently we got a request to alter the timings to of the job so that it would no longer run during the below time windows:-
Monday (only) : 9:30AM – 10:30AM CST
Monday – Friday : 12:20PM – 2:50 PM CST
All 7 days : 6:30pm-8:30pm CST
At first the only condition we had to deal with was the last one so we used the below script in the !process tab to implement it.
:SET &CURRENT_TIME# = &$PHYS_TIME_HHMM#
:IF &CURRENT_TIME# <= "1830"
: PRINT "IN FIRST CONDITION &CURRENT_TIME#"
:SET &ACTOBJ = ACTIVATE_UC_OBJECT('JOBP', job_plan_name)
: IF &CURRENT_TIME# >= "2030"
: PRINT "IN SECOND CONDITION &CURRENT_TIME#"
:SET &ACTOBJ = ACTIVATE_UC_OBJECT('JOBP',job_plan_name)
: PRINT "EXECUTION NOT ALLOWED AT &CURRENT_TIME#"
But now that we had to apply two more conditions and that too for separate days so we were not able to modify our script accordingly. So we ended up creating 5 different events. Although it solved the purpose but managing 5 events is always more difficult. Is there any other way we can stop the executing of the job during the given time windows while using a single event?