HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

VMS Batch Queue Job and Daylight Savings Time

 
SOLVED
Go to solution
Ken_180
Occasional Visitor

VMS Batch Queue Job and Daylight Savings Time

This spring, the area I live in will be begin observing Daylight Savings Time and we were examining the consequences of the time change to a job that runs on a batch queue every hour by resubmitting itself. In the Spring, when the server's time is moved forward, the batch job should run because the new time will be after the scheduled run time. However, in the Fall, when the server's time is moved back, the job will not run for two hours. I would appreciate receiving any ideas on how to get the job to run every hour even when the time is set back. Thanks!
12 REPLIES
Robert_Boyd
Respected Contributor
Solution

Re: VMS Batch Queue Job and Daylight Savings Time

Ken,

Here's one relatively simple idea:

Add code into the job so that it calculates to see when the next Fall time change will be and have it compare the next run time with that to see if the next run will be at or after the change. If so, have it submit another job which will sit and wait in a loop for the time change to occur (simply take a time value every minute or whatever interval you like ... and see if it is less than the previous one). When it detects the time change, it resubmits the original job to run immediately(or whatever interval after the top of the hour that it should run).

Alternatively, you could incorporate the wait loop in the same job as part of the resubmit code.

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Robert_Boyd
Respected Contributor

Re: VMS Batch Queue Job and Daylight Savings Time

I meant to mention that I already have code that I could give you that does the next time change calculation for EST. You'd have to adapt it to your own situation.

Ideally the routine would interpret the logical names that control the TDF/Daylight Savings rules in SYS$TIMEZONE_RULE for its input.

I may just have to edit the procedure I already have to get its input from the logical if it's available and post it here or on the DCL website.

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Ken_180
Occasional Visitor

Re: VMS Batch Queue Job and Daylight Savings Time

Robert,

Yes I would like to see your code. Thanks!

Ken
Robert_Boyd
Respected Contributor

Re: VMS Batch Queue Job and Daylight Savings Time

Here is daylight_check.com -- I'll also post cvtime.com which is called by this procedure.

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Robert_Boyd
Respected Contributor

Re: VMS Batch Queue Job and Daylight Savings Time

here's cvtime.com -- useful for translating various keyword values to actual dates.

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Robert_Boyd
Respected Contributor

Re: VMS Batch Queue Job and Daylight Savings Time

Here's a very involved procedure I wrote to manage TDF changes on cluster systems before the automatic change was available. This handles various UCX/TCPIP versions as well as VMS versions.

If you want an interesting challenge -- read through it and see if you can follow all of what it does! It has at least 3 if not 4 different modes it runs in depending on when/how it is invoked.

The most useful part for you Ken may be the section where it is trying to figure out what time NOW is relative to the next change.

I'm not suggesting you copy that code, but it could be useful as a framework.

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Ian Miller.
Honored Contributor

Re: VMS Batch Queue Job and Daylight Savings Time

Robert, will you post your dcl procedures on
dcl.openvms.org as well as they may be useful to others.
____________________
Purely Personal Opinion
Wim Van den Wyngaert
Honored Contributor

Re: VMS Batch Queue Job and Daylight Savings Time

A very simple solution.

Replace the submit by a permanent job doing

$b:
$ wait 00:59:59
$ submit xxx
$ goto b

Wim
Wim
Jan van den Ende
Honored Contributor

Re: VMS Batch Queue Job and Daylight Savings Time

Re Wim:

Sorry, that does NOT work!

At 30 mins before the clock set backward do this will NOT wait one hour, but two hours!

At, say, 02:30, the WAIT evaluates the time to wake up as 03:30. But it takes 2 hours before 03:30 comes to pass....

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Robert_Boyd
Respected Contributor

Re: VMS Batch Queue Job and Daylight Savings Time

Ian,

All 3 procedures are now submitted to dcl.OpenVMS.org -- should show up there before long.

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Wim Van den Wyngaert
Honored Contributor

Re: VMS Batch Queue Job and Daylight Savings Time

Sorry Jan but it does work.

The wait is waiting a number of seconds, not until a certain hour.

I set time to 7:00.
I did a wait 0f 01:00
I set time to 8:30.
The wait didn't finish.

Did the test in other direction too. No problem.

Wim
Wim
Robert_Boyd
Respected Contributor

Re: VMS Batch Queue Job and Daylight Savings Time

Wim, Did you try a test setting the time backward though? That is what happens with DST to standard time in the fall.

I haven't tried it myself, but I wonder what happens if I do a wait for x seconds and then reverse the clock. When will the timer actually fire off?

It would be easier to test this on the basis of say 3 minutes or some small interval that is easy to test.

I won't have time to try this until later today. It seems like that direction is the one that must be tested.

Robert
Master you were right about 1 thing -- the negotiations were SHORT!