Although Runcycles and Calendars objects are part of Workload Automation from the beginning, the flexibility of use offered by them compared to other Enterprise Schedulers is not fully understood. This blog aims to present some complex scenarios involving Runcycles and Calendars.
You want to schedule a Job based on a daily Runcycle as well as a monthly Runcycle and you want different parameters to be considered based on the run and different Start Times on each run:
In terms of Start Times offered at Runcycle Level, as Start Times are associated at the Runcycle, they can be different for different runs.
Also, the Variable Tables references allow values to be pursued for different runs based on when they are running, thus offering a variation on path of the job or other Variable References within a Job. Consider, for example, like say a Variant which is different in a SAP Job for different runs thus running different reports.
In the above example the first Runcycle runs the schedule at 08:00am daily, based on Variable Table DAILYVAR.
The second Runcycle runs the Schedule at 10:00am every 3rd of the month, based on Variable Table MONTHLYVAR.
The Job should execute on the 3rd of every month, but should not run if the day is not a workday.
The keyword FDIGNORE ensures the job does not run on the 3rd of the month if the day is not a workday, note that this is still based on HOLIDAYS Calendar (default Freeday Calendar for an environment).
If you want to base it on a specific Holiday Calendar for a Region, it can be accomplished by using the Calendar Name for the same:
In the above example, FREEDAYS Calendar named “HOLI_CAN” is considered as reference Calendar for calculating Freedays for FDIGNORE.
The above examples consider Freeday Calendar calculation based on HOLI_CAN and consider FDNEXT that is Next workday after Freeday if the 3rd is a Freeday , FDPREV that is Previous workday before Freeday if the 3rd is a Freeday , FDIGNORE that is ignore the 3rd of the month if it is a Freeday.
If you want to consider Saturday as a Working day, then the same runcycle can used as below, by including -SA thus excluding Saturday from Freedays and considering it as a working day:
SCENARIO 3 :
You want to exclude runs from a specific Runcycle without affecting the others:
You have three Runcycles in a scheduled Job for the 2nd day of every month, for 04:00am, 08:00am, and 10:00am.
If the 08:00am run is to be excluded for a specific date from the 3 Runcycles without excluding the other two runs, then you can do it in the below manner:
EXCEPT RUNCYCLE RULE3 01/02/2019
This helps exclude only the 8am run on 01/02/2019 while still retaining the 04:00am and 10:00am runs of 01/02/2019.
SCENARIO 4 :
You want to run a Jobstream on the 1st Wednesday of the Month at 03:00am, Start of Day is 08:00am. So, effectively you want to schedule on the 1st Tuesday of the month, but if Wednesday is first of the month, it has to be scheduled on the last day of the previous month:
By implementing the above, you schedule the Jobstream on the 1st Tuesday of the Month and on the last day of the month, while excluding the 7th of the month and excluding all days except Tuesday i.e Monday, Wednesday, Thursday, Friday, Saturday, and Sunday.
SCENARIO 1 :
You want to run a Jobstream on the 5th, 4th, 3rd, 2nd, 1st of the Month at 10:00 hrs, 16:00 hrs, 18:00 hrs and at 08:00 hrs, while at 11:00 hrs and 12:00 hrs on all other workdays, considering that you have a Calendar defined for 2nd Workday of the month (Consider SOD as 06:00 hrs):
The above example needs one Calendar to be defined WORKDAY2 for the 2nd Workday of the month, any other Calendar for some other workday would also suffice, but one Calendar would be needed, so we would offset from this one Calendar for the 3rd ,4th, 5th Workdays. First Workday can be implemented without a Calendar by using in-built functionalities of IWS as shown (very first Runcycle of the scenario). So, we schedule for runtimes: 10:00 hrs, 16:00 hrs and 18:00 hrs for the 1st Workday, 2nd Workday, 3rd Workday, 4th Workday and 5th Workday, then schedule for all Workdays at 08:00 hrs, 11:00 hrs and 12:00 hrs while excluding times 08:00 hrs, 11:00 hrs and 12:00 hrs for 1st Workday, 2nd Workday, 3rd Workday, 4th Workday and 5th Workday.
SCENARIO 2 :
You want to schedule a Jobstream at 03:00 hrs on the 2nd Workday when Start of Day is 08:00 hrs:
The Runcycle can be implemented by using the 2nd Workday of the Month Calendar WORKDAY2 and using an Offset of -1 DAYS, so you could offset from a Calendar .