cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Time Window?

former_member160248
Participant
0 Kudos

Recently and for the first time in our shop I scheduled a group of scripts/chains to execute on the first Sunday of the month. This worked fine for March, however, when they were automatically submitted for the next execution they are scheduled for 11/1/2009 not 4/5/2009. November 1st, just happens to be the next time that the 1st Sunday happens to be also the 1st day of the month. Perhaps a coincidence I am not sure.

The submit definition looks like this:

Time Window: OGE_FIRST_SUNDAY

Submit Frame: RW_EVERY_MONTH

Time Window OGE_FIRST_SUNDAY is defined as:

Day within the week of the month

From: First : Sunday

Until: blank : blank

No exceptions are defined.

What am I missing? Thanks is advance for any assistance.

Kind Regards,

David Carr

Accepted Solutions (1)

Accepted Solutions (1)

former_member160248
Participant
0 Kudos

Hi Anton,

I fear the answer to this follow-up question but here goes. I took your advice and set up a test job with a submit frame of 28 days and the "skip interval" unchecked. You were 100% correct the job re-scheduled on the correct day but the time was at midnight not the time time of day (3:00pm) that it was originally defined. Am I forced now since I am on V6 to setup a time window for each time of day? We have monthly scripts/chains that kickoff at virtually every 15 minutes for 3 or 4 hours so it seems that I would be forced to setup 12 -16 additional time windows. Am I way off base? Thanks.

David

Former Member
0 Kudos

Hi David,

If I understand your request correctly, you want to run certain jobs every 15 minutes for 3-4 hours on a month end related day.

Let's take the following example: run job X from 13:00 to 16:00 (last job is at 15:45) every 15 minutes on the last Sunday of the month.

This requires the following two objects:

- time window TW_X, every last Sunday from 13:00 to 15:59

- submit frame SF_X, every 15 minutes (original time unchecked)

Then you submit job X with timewindow TW_X and submit frame SF_X. That's it.

The first job will start at 13:00 on the upcoming last Sunday of the month, it will run every 15 minutes, and when the execution at 15:45 finishes, it will jump to the next last Sunday of the month 13:00.

Does this answer your question ?

So you may need a few extra time windows for the different windows of execution, but not for each interval within that window.

Regards,

Anton.

Answers (2)

Answers (2)

former_member160248
Participant
0 Kudos

Hi Anton,

Your interpretation of the scenario is not quite accurate, however, your recommendation is still applicable I think. In short, I was hopping to avoid the need to create a different time window for each combination of monthly interval and start time. For example, FIRSTSUNDAY/400am; FIRSTSUNDAY/0430am;FIRSTSUNDAY/0445am etc. It appears though to be unavoidable. Our previous scheduler forced us to do some things that may not make sense now so perhaps we now have some motivation to clean up some things. Thanks for sharing your expertise and advice.

Regards,

David

Former Member
0 Kudos

Hi David,

So we are talking about different jobs that run about 15 minutes apart.

Then you can do the following:

- create a submit frame SF_WEEKLY_AT_ORIGINAL_TIME (you can choose your own name of course) with period WEEKLY and original time SET

- create a time window for the last sunday of the month (no time restriction needed)

Now submit the jobs:

- one at 04:00 AM with the time window and submit frame above

- one at 04:30 AM with the same time window and submit frame

- ...

Now the logic when the job of 04:00 AM finishes is: try one week later (next sunday) at 04:00 AM. Doesn't work because window is closed. Then try one week further, one week further, until the next last sunday is found. Because the original time property is set, the job will stick to 04:00 AM.

Same for the 04:30 job, but that one will stick to 04:30.

The catch is to use a weekly (or even daily) submit frame, which in this scenario will always result in finding the next sunday because there are always a complete number of weeks between two valid sundays.

You can of course give the submit frame a different name if you use it for special cases only.

Regards,

Anton.

former_member160248
Participant
0 Kudos

Hi Anton,

You are correct on the interpretation.

I set up a submit frame for "every 7 days" since I do not have the option for a week. I do not see anything that states "original time SET" I have a check box that say "Skip interval whenn time window is closed". Should that be set?

I set up the time window as monthly : "the first sunday of every month" as opposed to advanced : "day within the week of the month from first Sunday".

Anyway, I submitted a job with the definitions above but left the date as today and changed the time to 10:00am. The result was a scheduled job for 4/5 but at midinight not 10:00am.

Should I be concerned? I have subsequently submiited the job for 4/5 and 10:00am so I know he next run will be fine. It is the run after that concerns me. I could just let it go and see but the result is still a ways off and I have a number of other jobs to adjust to what you described earlier. Thamks.

Regards,

David

Former Member
0 Kudos

Hi David,

Yes you should set the "Skip interval when time window is closed" checkbox, that should be the "at original time" setting I talked about earlier.

The other behaviour you see is normal. The time window is applied when submitting, the submit frame is not applied until the job is finished.

When you submit a job outside its time window, CPS will take the first available valid time for the job. This is midnight if your time window is open the entire day.

So if you want to use more generic time windows for this set of jobs (which makes sense), you will need to set the first job up for a valid execution time. From then on, the submit frame will make it stick to that time.

Regards,

Anton.

Former Member
0 Kudos

Hi David,

You are experiencing two things here:

Monthly intervals of this kind (nth Monday/Tuesday/... in the month) are always tricky, because in fact the actual interval between two openings of the time window can be shorter than one month.

For instance the first Saturday now is March 7th, and next month that will be on the 4th already.

So an interval or submit frame of one month will be too long for some of the gaps.

Also, the "at original time" property will make the scheduler continue to apply the submit frame until it finds a valid date according to the time window (so in this case after March 1st with a submit frame of one month, it tries April 1st, May 1st, ... until it finds November 1st). Without the "at original time" flag set, the scheduler simply applies the submit frame once then takes the first valid time in the time window on or after the result.

The solution depends on the version you use, V6 or V7. In V7, there is a submit frame option to let the submit frame simply follow all openings of the time window. Then you do not have to worry/think about the above, it will work as expected.

In V6, the trick is to use a submit frame without the at original time flag set and with a period shorter or equal to the shortest possible gap between two openings, in this scenario you could use 28 days as submit frame for instance.

Regards,

Anton.