- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Submit After Question.
Operating System - OpenVMS
1757854
Members
2381
Online
108866
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2008 03:35 PM
11-23-2008 03:35 PM
Re: Submit After Question.
As Hoff has pointed out, you can't rely on a job starting exactly AT the /AFTER time (that's why it's "/AFTER" not "/AT"). The only thing you can say for sure it it won't run BEFORE that time, though in a cluster with badly synchronized clocks, even that isn't necessarily a given!
An alternative to using /AFTER to schedule the time for a job is to let the job run "forever" in a loop with a WAIT calculated to delay until the next scheduled time. For your case, try:
$ mins="20" ! must be a numeric string
$ Loop: wait 'F$CVTIME(F$DELTA("",F$CVTIME(F$CVTIME("",,"HOUR")+":"+mins+":00+"+F$STRING(F$CVTIME("",,"MINUTE").GES.mins)+":0:0.0","ABSOLUTE")),,"TIME")
$ ! It is now 20 minutes past the hour
$ ! do your stuff
$ GOTO Loop
Depending on how accurate you need the time, I've sometimes found I need to add 100th of a second to the wait time (replace the string +":0:0.0" with +":0:0.01" to make sure it doesn't trigger just before the target time - truncation in DCL date arithmetic.
All this costs you is a process slot.
To prevent conflicts with other jobs, check out the SYNCHRONIZE command.
An alternative to using /AFTER to schedule the time for a job is to let the job run "forever" in a loop with a WAIT calculated to delay until the next scheduled time. For your case, try:
$ mins="20" ! must be a numeric string
$ Loop: wait 'F$CVTIME(F$DELTA("",F$CVTIME(F$CVTIME("",,"HOUR")+":"+mins+":00+"+F$STRING(F$CVTIME("",,"MINUTE").GES.mins)+":0:0.0","ABSOLUTE")),,"TIME")
$ ! It is now 20 minutes past the hour
$ ! do your stuff
$ GOTO Loop
Depending on how accurate you need the time, I've sometimes found I need to add 100th of a second to the wait time (replace the string +":0:0.0" with +":0:0.01" to make sure it doesn't trigger just before the target time - truncation in DCL date arithmetic.
All this costs you is a process slot.
To prevent conflicts with other jobs, check out the SYNCHRONIZE command.
A crucible of informative mistakes
- « Previous
-
- 1
- 2
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP