This sounds like something you would to do in the Application and not the EVENT. With scenarios like this we create a RUNME variable and add it into the job.
Someone may be able to give an exact example, but I have a few I found that are working in our environment. Maybe you can tweak them for your scenario.
Run based on time and day:
APPL.RUN7='FALSE';
if ((APPL._SHH =='07' && APPL._SMN == '30') && ( today('Monday'))) APPL.RUN7='TRUE';
Run based on a calendar:
APPL.RUNME = 'FALSE';
if (today('FISDAY5')) APPL.RUNME='TRUE';
Run between 7am and 11 am:
APPL.RUNME7AM='FALSE';
if (APPL._SHH == '07' || APPL._SHH == '08' || APPL._SHH == '09' || APPL._SHH == '10' || APPL._SHH == '11') APPL.RUNME7AM='TRUE';
In this doc link there are many examples of how to schedule based on dates, month etc. On page 12 there is one that schedules based on day and day of month (below).
https://ftpdocs.broadcom.com/cadocs/q0/q000771e.pdfObjective
Run a job on the last Saturday of the month, provided this date falls on the 26th
through to the 31st day of the month. Otherwise, run the job on the following
Saturday (in other words, the first Saturday of the next month).
Solution
Use the following JavaScript script at Event trigger time for the job:
WOB.runme=false;
genTime('lw','today less 1 week');
if (today('last saturday of month') && APPL._SDD > '25')
WOB.runme=true;
if (today('first saturday of month') && lwDD < '26')
WOB.runme=true;
Use the %WOB.runme variable as the run frequency in the job definition.
------------------------------
DARDEN Corporation
Orlando, FL
------------------------------
Original Message:
Sent: Jul 28, 2022 04:27 PM
From: DONNA DOMOVIC
Subject: Suspend/Resume with multiple criteria
Hello,
One of our applications has an event that they want to run as follows:
- Run hourly on workdays from 06:00 through 18:00.
- Run hourly on THANKSGIVING_DAY2 (defined to the SYSTEM calendar as a holiday) from 06:00 through 18:00.
- Run hourly on CHRISTMAS_EVE (defined to the SYSTEM calendar as a holiday) from 06:00 through 18:00.
We know we can set these up and run them as 3 events (ie workdays, THANKSGIVING_DAY2, and CHRISTMAS_EVE) with appropriate suspend/resume criteria but was wondering if there's any way to do this in 1 event.
We did try things like the following but they didn't work
- Suspend: 18:30 THANKSGIVING_DAY2 CHRISTMAS_EVE workdays
- Resume: 05:30 THANKSGIVING_DAY2 CHRISTMAS_EVE workdays
We also tried using THANKSGIVING_DAY2 alone in the RESUME but it didn't work.
Does anyone have ideas on how to accomplish what we want with a single event or do we need to set up 3 separate ones to cover all of these situations?
Thanks,
Donna Domovic