- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Submiting a batch job to run automatically twice a...
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
03-27-2008 05:27 AM
03-27-2008 05:27 AM
Ex. April 30th, August 31st and December 31st
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 05:42 AM
03-27-2008 05:42 AM
Solution$ MONTHS = "//FEB/MAR/APR/MAY/JUN/JUL/AUG/SEP/OCT/NOV/DEC/JAN"
$ YEAR = 'F$CVT(,,"YEAR")
$ MONTH= 'F$CVT(,,"MONTH")'
$ IF MONTH .EQ. 12 THEN YEAR = YEAR + 1
$ MONTH = F$ELEMENT(MONTH+3, "/", MONTHS)
$ SUBMIT/AFTER=1-'MONTH'-'YEAR' 'f$env("procedure")
submits for the first day every 3 months.
I search for a trick to find the last day of month easily, but I guess others will have posted in the meantime...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 06:00 AM
03-27-2008 06:00 AM
Re: Submiting a batch job to run automatically twice a year
day, but only _do_ something on particular
days.
> [...] automatically twice a year
> [...] every quarter [...]
Around here, "every quarter" would involve
more than "twice a year". (And perhaps once
between April and August.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 06:26 AM
03-27-2008 06:26 AM
Re: Submiting a batch job to run automatically twice a year
$ Temp = F$CVTIME("01"+(Temp-F$ELEMENT(0,"-",Temp))+"+125-","ABSOLUTE")
$ Last3 = F$CVTIME("01"+(Temp-F$ELEMENT(0,"-",Temp))+"-1-",-
"ABSOLUTE","DATE")
$ submit /after='last3 'f$env("procedure")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 06:32 AM
03-27-2008 06:32 AM
Re: Submiting a batch job to run automatically twice a year
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 06:55 AM
03-27-2008 06:55 AM
Re: Submiting a batch job to run automatically twice a year
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 06:55 AM
03-27-2008 06:55 AM
Re: Submiting a batch job to run automatically twice a year
In 2004 I posted this to dcl.openvms.org:
http://dcl.openvms.org/stories.php?story=04/10/15/8590853
A procedure that lets you specify all kinds of variables for calculating next submit.
eg: Last sunday of every month, or (your latest question) first Friday after 8th of month where month # a certain multiple.
This procedure contains a fairly extended "manual" in its comments.
hth
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 06:57 AM
03-27-2008 06:57 AM
Re: Submiting a batch job to run automatically twice a year
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 07:36 AM
03-27-2008 07:36 AM
Re: Submiting a batch job to run automatically twice a year
April, August, and December is three times a year, neither two nor four!
That said, the approach of adding to the current month will work. You can use the F$CVTIME lexical function within the DCL procedure to extract the current month from the current time (which can be obtained using F$TIME).
The "second Friday" part is trickier. If I were doing the computation, I would likely get the weekday (also available using F$CVTIME) for the 1st of the month and then compute the adjustment, or I could compute the day of the week for the 13th (the earliest date within a month that can be the second Friday), and adjust accordingly.
Note that F$CVTIME when used in "COMPARISON" mode returns numeric values, which are easier to process in this situation.
One should also take care in the event that the procedure is run at some other time that the calculations do not misfire.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 07:50 AM
03-27-2008 07:50 AM
Re: Submiting a batch job to run automatically twice a year
>>>
for the 13th (the earliest date within a month that can be the second Friday),
<<<
In MY book, when the 1st of any month is a Friday, that month the 8th is counted as the second Friday... :-)
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 08:07 AM
03-27-2008 08:07 AM
Re: Submiting a batch job to run automatically twice a year
and from time to time update the command file.
You do not need to resubmit it, just do, if your command file is a.com, after modfying it
from a.com;1 to a.com;2
$ copy/overlay a.com;2 a.com;1
and the "new" a.com will be used for the next submit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 10:26 AM
03-27-2008 10:26 AM
Re: Submiting a batch job to run automatically twice a year
Indeed, I mis-spoke[sic].
The second Friday of the month ranges from the 9th (when the month starts on a Thursday), to the 15th (when the month starts on a Friday).
(smile) Obviously, one needs to exercise caution when dealing with the fourth and fifth weeks of the month.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 12:49 PM
03-27-2008 12:49 PM
Re: Submiting a batch job to run automatically twice a year
My apologies, this does not seem to be my day for calendars.
The lowest day of month for the "second Friday" is the 8th (if the month starts on the previous Friday). The highest day of month is the 14th (if the month started on a Saturday).
My apologies for the errata.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 12:54 PM
03-27-2008 12:54 PM
Re: Submiting a batch job to run automatically twice a year
The "trick" to get the last day of the month is to use "one day before the start of the next month", to wit:
$ LASTDATE = F$CVTIME("1-MAR-2008-1-0",,"DATE)
Yields 29-Feb-2008. Note that this automatically deals with leap years.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2008 05:13 PM
03-27-2008 05:13 PM
Re: Submiting a batch job to run automatically twice a year
As others have suggested, I find you're much better off having the job execute frequently (daily is easiest) and checking on each run if there's anything to be done.
A few tricks to make coding easier and clearer...
For a job that should do something each week day:
$ SUBMIT self for tomorrow
$ GOTO 'F$CVTIME(,,"WEEKDAY")
$
$ Saturday:
$ Sunday:
$ EXIT
$
$ Monday:
$ Tuesday:
$ Wednesday:
$ Thursday:
$ Friday:
$ ! Do work here
Obvious modifications for doing different things on specific weekdays.
For first of the month:
$ IF F$CVTIME(,,"DAY").EQS."01"
$ THEN
$ ! Today is first of month
$ ENDIF
For last day of month
$ IF F$CVTIME(,,"MONTH").NES.F$CVTIME("+1-",,"MONTH")
$ THEN
$ ! Today is last day of month
$ ENDIF
For a calendar of arbitrary dates, store them in a file:
$ PIPE SEARCH ACTION_DATES.DAT "''F$CVTIME(,"ABSOLUTE","DATE")'" >nl: 2>nl:
$ IF $SEVERITY.EQS."1"
$ THEN
$ ! today is listed in ACTION_DATES.DAT
$ ENDIF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2008 09:38 AM
04-01-2008 09:38 AM
Re: Submiting a batch job to run automatically twice a year
I want to be able to execute a job that will check for a certain date and if it is that date to submit it automatically.
Let's say i want this job to run on the 2nd week on a particular day {tuesday) in June and then again in Decemember?
Is there a simple DCL command to do this, without making it too complicated!
Ex.
Maybe something that says
if today is the 14th of june or Decemeber and the day is tuesday then submit this job?
Something to that effect?
Just want somethinmg simple if at all possible.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2008 10:01 AM
04-01-2008 10:01 AM
Re: Submiting a batch job to run automatically twice a year
Perhaps, but I doubt it.
> [...] check for a certain date [...]
I think that that's been provided already.
> Let's say i want this job to run on the 2nd
> week on a particular day {tuesday) [...]
No problem. Define "2nd week".
> Just want somethinmg simple if at all
> possible.
A clear, unambiguous description of the
problem can be a big help. I haven't seen
one yet. Some thought may be required. Get
used to it. If you can't specify the problem
clearly enough for someone else to do your
job for you, then you may need to do some
playing around with the suggestions you get,
to see if you can adapt the concepts to
whatever it is that you actually want to do.
Am I being too grumpy again?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2008 06:44 AM
04-03-2008 06:44 AM
Re: Submiting a batch job to run automatically twice a year
Am I missing something?
$ if (f$search("steve_ward:'node'_ward.com") .eqs. "")
$ then
$ write sys$output "WARD.COM file missing! Program will NOT run."
$ goto the_end
$ else
$ SUBMIT/NOPRINT/QUE=SYS$BATCH/LOG=STEVE_WARD:[000000]'node'_WARD.COM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2008 07:07 AM
04-03-2008 07:07 AM
Re: Submiting a batch job to run automatically twice a year
>>>
if (f$search("steve_ward:'node'_ward.com") .eqs. "")
<<<
Is this an exact copy/paste, or a nearly accurate attempt to re-type?
It SHOULD be (and for clarity I added spaces, which do NOT belong!)
if (f$search(" steve_ward: ' ' node ' _ward.com") .eqs. "")
Notice: Between double quotes, you need TWO apostrophes to begin synbol substitution, and one to end it.
And why do you f$search
"steve_ward:'node'_ward.com")
but if you find it, you SUBMIT
>>>
STEVE_WARD:[000000]'node'_WARD.COM
<<<
It will work a lot better of you SUBMIT STEVE_WARD:'node'_WARD.COM
Explanation:
In the search, STEVE_WARD obviously is a logical name for a directory (or you would not find anything)
But in STEVE_WARD:[000000] you specify a DEVICE )potentially a Concealed Device) named STEVE_WARD; which has a top-directory [000000] (for concealed devices that would be the pseudo directory, pointing to the root level itself), where the .COM file should reside.
But, STEVE_WARD can NEVER be simaultabiously both a Device spec AND a Directory-spec.
hth
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2008 07:08 AM
04-03-2008 07:08 AM
Re: Submiting a batch job to run automatically twice a year
>>>
simaultabiously
<<<
read that as simultanously
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2008 08:11 AM
04-03-2008 08:11 AM
Re: Submiting a batch job to run automatically twice a year
Why doesn't it submit the job when it find the com file that I am searching for??
It just gives me file is miising, but it isn't!
$ if (f$search("home_scr:'node'_snapshot.com") .eqs. "")
$ then
$ write sys$output "SNAPShot.COM file missing! Program will NOT run."
$ goto the_end
$ else
$ SUBMIT/NOPRINT/QUE=sys$BATCH/LOG=home_LOGS:home_scr:[SCRIPTS]'node'_SNAPSHot.COM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2008 08:39 AM
04-03-2008 08:39 AM
Re: Submiting a batch job to run automatically twice a year
read Jan's comments again!
Inside a quoted string (such as in your IF statement), you need two apostrophes to begin symbol substitution.
Therefore you need apostrophe apostrophe node apostrophe.
See the attached text file for details
Duncan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2008 09:20 AM
04-03-2008 09:20 AM
Re: Submiting a batch job to run automatically twice a year
%SUBMIT-F-OPENIN, error opening $1$DUA1:[ward]Trek_SNAPSHOT.COM; as input
-RMS-E-FNF, file not found
Instead of the
write sys$output "SNAPSHRINK.COM file missing! Program will NOT run."
So if it does find that file that it is searchig the submit works, but then when I delete that file and reran it, if should come up with the sys$output message?
Shouldn't it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2008 10:16 AM
04-03-2008 10:16 AM
Re: Submiting a batch job to run automatically twice a year
>>>
%SUBMIT-F-OPENIN, error opening $1$DUA1:[ward]Trek_SNAPSHOT.COM; as input
-RMS-E-FNF, file not found
Instead of the
write sys$output "SNAPSHRINK.COM file missing! Program will NOT run."
<<<
Now _I_ am getting a little confused.
So, some questions
- WHAT is the exact name of the file you want to submit
- WHERE (device, directory) is that file located
- HOW does STEVE_WARD translate
- WHAT is the value of NODE in the context of this process (add a
$ SHOW SYMBOL NODE
and
$ SHOW LOGICAL/FULL STEVE_WARD
as the lines before the f$SEARCH)
I am beginning to think that I was put on the wrong track (derailed, actually) until now.
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2008 10:29 AM
04-03-2008 10:29 AM
Re: Submiting a batch job to run automatically twice a year
%SUBMIT-F-OPENIN, error opening $1$DUA1:[ward]Trek_SNAPSHOT.COM; as input
-RMS-E-FNF, file not found
Instead of the
write sys$output "SNAPSHRINK.COM file missing! Program will NOT run."
<<
It looks like you may not be doing any error checking. Since you got an ERROR, processing of the command procedure stopped and exited - so no "write sys$ouput"