- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- batch queue
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
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
Discussion Boards
Community
Resources
Forums
Blogs
- 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
10-13-2004 01:13 AM
10-13-2004 01:13 AM
I have to create a job to run automatically every first and 15-th day of every month?
For excecuting it every day at 01:00 I have created as below:
submit/AFTER="TOMORROW +1" DSA1:[VODAFONE.TEST]bep1_backup_test.com
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2004 01:22 AM
10-13-2004 01:22 AM
Solutionif you submit in same month you can simply write:
$! Get today date in forma dd-mmm-yyyy hh:mm
$ MYDATE=F$CVTIME("","ABSOLUTE")
$! Change first 2 chars
$ MYDATE="15"+F$EXTRACT(2,9,MYDATE)
$! Submit command
$ SUBMIT/AFTER='MYDATE' DSA1:[VODAFONE ...
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2004 01:29 AM
10-13-2004 01:29 AM
Re: batch queue
As Antonio has illustrated make use of F$CVTIME() lexical. That will help you.
regards
Mobeen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2004 01:37 AM
10-13-2004 01:37 AM
Re: batch queue
A possible solution is to use an auxiliar command file as (batch.com):
$set noon
$io=f$cvtime("","absolute","day")
$if io .eqs. "1" .or. io .eqs. "15" then -
submit DSA1:[VODAFONE.TEST]bep1_backup_test.com
$submit/after="tomorrow +1" batch.com
$exit
Best Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2004 01:40 AM
10-13-2004 01:40 AM
Re: batch queue
$ submit/after="tomorrow +14-00:00:00.00" x.com
otherwise, youi may have to calculate the next date to have it run. There are several ways to do this - attachted an example.
OpenVMS Developer & System Manager
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2004 01:55 AM
10-13-2004 01:55 AM
Re: batch queue
A further point is to ensure you do the re-submitting at the beginning of your batch job incase of problems or delays.
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2004 02:36 AM
10-13-2004 02:36 AM
Re: batch queue
It may be helpful to know that DCL/VMS default all parts of a datespec to the current. So providing "15-" for a date will give the 15th of the current month.
Second, adding 31 days to a date give next month (and next year if needed). Combined this suggests the solution (in test file format):
$if p1.eqs."" then p1 = f$cvtime("","absolute","day")
$if 'p1'.lt.15
$then
$ next = f$cvt("15-","absolute")
$else
$ next = "1-" + f$cvt("+31-","absolute","month") -
+ "-" + f$cvt("+31-","absolute","year")
$endif
$show symb next
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2004 06:26 AM
10-13-2004 06:26 AM
Re: batch queue
Zoals gezegd: er zijn meerdere wegen die naar Rome leiden, nietwaar? Ik hou alleen niet van die one-liners - ze hebben de neiging nogal obscuur te zijn (en dientengevolge niet te onderhouden).
In English for thos that do not understand Ditch (cannot help Hein is Dutch like me...)
As said: there are more road leading to Rome. I just don't like one-liners - they tend to be rather obscure (and hance unmaintainable)
Willem
OpenVMS Developer & System Manager
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2004 11:55 AM
10-13-2004 11:55 AM
Re: batch queue
Finding the 1st and 15th of this month is easy:
$ first=F$CVTIME("1-","ABSOLUTE")
$ fifteenth=F$CVTIME("15-","ABSOLUTE")
To work out the 1st and 15th of next month regardless of the current date:
$! find a date in next month
$ next=F$CVTIME("1-+31-","ABSOLUTE")
$ nextmonth=-
F$CVTIME(next,"ABSOLUTE","MONTH")+-
"-"+F$CVTIME(next,,"YEAR")
$ first="1-"+nextmonth
$ fifteenth="15-"+nextmonth
The compound time "1-+31-" breaks into two parts, "1-" means "first of this month", then "+31-" means add 31 days. This will always be a date in the following month.
(Hopefully this isn't too obscure for Willem?)
Slight variation and generalisation- to find the next "Nth of the month", you need to consider the current date:
$ N=15
$ IF F$CVTIME(,,"DAY").LT.N
$ THEN ! Nth of this month
$ nth=F$CVTIME("''N'-","ABSOLUTE")
$ ELSE ! Nth of next month
$ ! above code reduced to 1 liner
$ nth="''N'-"+-
F$CVTIME("1-+31-","ABSOLUTE","MONTH")+-
"-"+F$CVTIME("1-+31-",,"YEAR")
$ ENDIF
To have a job that runs on 1st and 15th, you could either code up logic that alternates between 1st and 15th, or you could have two periodic jobs, one resubmitting itself for 1st and the other for the 15th, calling the same procedure to do the actual work. For example:
NTH_OF_MONTH.COM
$!
$! P1=day in month to execute job (D=1st)
$! P2=procedure to execute (required)
$! P3=extra SUBMIT qualifiers (optional)
$!
$ N=p1
$ IF N.EQS."" THEN N=1
$ IF F$CVTIME(,,"DAY").LT.N
$ THEN ! Nth of this month
$ nth=F$CVTIME("''N'-","ABSOLUTE")
$ ELSE ! Nth of next month
$ nth="''N'-"+-
F$CVTIME("1-+31-","ABSOLUTE","MONTH")+-
"-"+F$CVTIME("1-+31-",,"YEAR")
$ ENDIF
$
$ SUBMIT/AFTER="''nth'" 'p3' -
'F$ENVIRONMENT("PROCEDURE") -
/PARAM=("''p1'","''p2'","''p3'","DOIT")
$ IF p4.EQS."DOIT" THEN @'p2'
$ EXIT
$ @NTH_OF_MONTH 1 MYJOB.COM "/QUEUE=MYQUEUE"
$ @NTH_OF_MONTH 15 MYJOB.COM
This easily generalises to any monthly schedule you like.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2004 01:00 PM
10-13-2004 01:00 PM
Re: batch queue
(Since you are only adding after the 15th)
I was just testing you guys...
:-)
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2004 11:18 PM
10-14-2004 11:18 PM
Re: batch queue
For several years now we have a general purpose routine GET_NEXT_DATUM which does this.
(and more: also gives answers like LAST WEDNESDAY (of month) or LAST MONDAY before n-th of the month).
Calculations are leapyear aware.
To make it useful to a wider public I translated the instructions and messages into English, and posted it to DCL.OPENVMS.ORG
When it will be published there, I post the URL as well.
Hth
Cheers.
Have one on me.
Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2004 12:19 AM
10-15-2004 12:19 AM
Re: batch queue
the procedure is at
http://dcl.openvms.org/stories.php?story=04/10/15/8590853
Usage: eg
@
or
@
the first one should be clear.
The second one returns 6, 7, ... 11, or 12;
whichever is sunday,
of THIS month if that is tomorrow or later, else of next month.
And then eg.
$ submit /after="''next_datum'+1:23"
will mean at the specified day at 1:23.
Until now _WE_ have not found it to be lacking. YMMV
Cheers
Have one on me
Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2004 06:47 PM
10-15-2004 06:47 PM