KumarRahul605332

Need to stop execution of an event based job during specific time intervals

Discussion created by KumarRahul605332 on Oct 30, 2017
Latest reply on Oct 31, 2017 by Wolfgang_Brueckler_1288

Hi there!

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#
:PRINT "APPLE&CURRENT_TIME#"
:IF &CURRENT_TIME# <= "1830"
:  PRINT "IN FIRST CONDITION &CURRENT_TIME#"
:SET &ACTOBJ = ACTIVATE_UC_OBJECT('JOBP', job_plan_name)
:ELSE
:  IF &CURRENT_TIME# >= "2030"
:    PRINT "IN SECOND CONDITION &CURRENT_TIME#"
:SET &ACTOBJ = ACTIVATE_UC_OBJECT('JOBP',job_plan_name)
:  ELSE
:    PRINT "EXECUTION NOT ALLOWED AT &CURRENT_TIME#"
:  ENDIF
:ENDIF 


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?

Thank you.

Kumar

 

 

Outcomes