'How can I prevent a CA7 job with two schedule IDs from conflicting when they run on the same day?
I have a single job with two schedule ID’s. One runs the job the last day of the month and the other schid runs the last Sunday of the month. The problem I’m trying to correct arises when the last day of the month falls on a Sunday which causes a conflict between the two schedules.
My first thought was to split the two schids into two separate job names, while making one job a requirement for the other so they can’t run at the same time. The problem is this scenario would only apply on the rare days they both run and on all other days the requirement wouldn’t be met.
I’m not extremely familiar with ca7 so thought I’d look for some input. Can a schid be created with a conditional statement?
Solution 1:[1]
I think two schids will be needed. The options assume a calendar that specifies all days as processing days.
Option 1
Schid=1 schedules the job on the last Sunday of the month UNLESS that Sunday falls on the last day of the month.
Schid=2 schedules the job on the last day of the month.
ID=001 ROLL=N INDEX=+000
SCAL= DOTM=2000 LEADTM=0010 STARTM=1950
MONTHLY DAY=SUN WEEK=-00 MONTH=ALL
MONTHLY NRDAY=-00 MONTH=ALL
ID=002 ROLL=N INDEX=+000
SCAL= DOTM=2000 LEADTM=0010 STARTM=1950
MONTHLY RDAY=-00 MONTH=ALL
Option 2
Schid=1 runs the last day of the month unless that day falls on a Sunday.
Schid=2 runs on the last Sunday of the month.
ID=001 ROLL=D INDEX=+000
SCAL= DOTM=1300 LEADTM=0030 STARTM=1230
MONTHLY NDAY=SUN WEEK=-00 MONTH=ALL
MONTHLY RDAY=-00 MONTH=ALL
ID=002 ROLL=D INDEX=+000
SCAL= DOTM=1300 LEADTM=0030 STARTM=1230
MONTHLY DAY=SUN WEEK=-00 MONTH=ALL
Another approach is to define a separate calendar with precisely the days I want the job to run so the schedule definition is pretty simple.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | l england |