Operating System - OpenVMS
1828238 Members
3107 Online
109975 Solutions
New Discussion

how to submit a daily job?

 
SOLVED
Go to solution
Davor_7
Regular Advisor

how to submit a daily job?

Hi all
a simple question
how can i submit a job and let it do every 8 am?

i know, this is a simple question, but i'm new here :p

thanks in advance...
21 REPLIES 21
Hein van den Heuvel
Honored Contributor
Solution

Re: how to submit a daily job?


The basic approach is to start the batch job once, and have it re-submit of itself as a first step.

This would be done with a line like:

$subm/noti/log/noprint/after="tomorrow+8:0:0" 'f$environment("procedure")

- Try it!
- Check the help!
- Think about whether you want the exact version number there.
- realize that batch jobs are submitted by file-id, not by name (so be attentive with edits)
- consider a 'jacket' job to pick up the most recent atch job version.
- consider a 'cron' super batch job to launch weekly/daily/hourly jobs
- Check the help again:
= $help dcl date
= $help lexi [f$parse] [f$searc] [f$env]

Google for more examples

Enjoy,
Hein.
Peter Quodling
Trusted Contributor

Re: how to submit a daily job?

Of course, help submit, will also give some clues. (ANd don't forget the System Manager's Manual in the documentation set...)

Peter Q

Leave the Money on the Fridge.
Davor_7
Regular Advisor

Re: how to submit a daily job?

thanks both~

i know that SUBMIT is to submit a batch job.and i also looked into the help info on this command.
there is actually a parameter (/after) can identify the time you need to submit it. but i have no idea about how to submit once and let it run each day...

that's my question~

let's discard the document here, due to this is simple question, just some command need be typed here, who can answer it?
thanks!
Mike Reznak
Trusted Contributor

Re: how to submit a daily job?

Hi,

you have to have inside the procedure the command for resubmit. The best is to put it somewhere near the beginning. But it depends on how your procedure is structured. It's the same as it have been mentioned here.

$subm/noti/log/noprint/after="tomorrow+8:0:0" 'f$environment("procedure")

That will do the job.

Mike


...and I think to myself, what a wonderful world ;o)
Willem Grooters
Honored Contributor

Re: how to submit a daily job?

Looks you want "cron" implememted on VMS ;-)
The others have given the VSM solution: Let the job resubmit itself.
Otherwise, there are solutions in the market that do the type of thing you want. Eventually, there might even be "cron for VMS"

Willem
Willem Grooters
OpenVMS Developer & System Manager
Peter Quodling
Trusted Contributor

Re: how to submit a daily job?

There was a Cron for VMS (albeit sometime back...) DECscheduler, as I recall. But it was sold to CA, who have probably filed it. There was a thing called Kronos on the Freeware distribution - probably back around version 4 or so. (of the freeware distribution).

q
Leave the money on the Fridge...
Leave the Money on the Fridge.
Wim Van den Wyngaert
Honored Contributor

Re: how to submit a daily job?

I have a script that is used at boot time to get a job in a queue at a certain hour.
See enclosure.

Wim
Wim
Hein van den Heuvel
Honored Contributor

Re: how to submit a daily job?



>> let's discard the document here, due to this is simple question, just some command need be typed here, who can answer it?

99% if the people READING this forum can.
I can, and I did answer the question.

Read more. Write less.

Best regards,
Hein.
Jim Geier_1
Regular Advisor

Re: how to submit a daily job?



The product formerly known as DECscheduler is still available from and supported by CA. Now called Unicenter Job Management for OpenVMS, the product is fully supported and even runs on OpenVMS 8.2 on Alpha and I64.

This is a piece of good software that, in my opinion, should not have been sold, and probably should have been integrated into the OpenVMS operating system.

I agree with the other replies, having a job resubmit itself is a reasonable solution is a small number of such jobs are to be managed. I typically break down the command to two or three commands, partly because I want the move recent version submitted, not necessarily the version currently running:

$ procedure_file = f$environment("procedure")
$ procedure = f$element(0,";",procedure_file)
$ submit/after="tomorrow+0-08:00:00" 'procedure'
Robert_Boyd
Respected Contributor

Re: how to submit a daily job?

Due to the problems with the queue manager using the file id to track a file that has been queued for batch, I find it more reliable to use a "resubmitter" procedure as a front end to the actual procedures that need to be run at regularly scheduled intervals. That way when you have a job fire up to run, it actually runs the most recent version rather than the last one submitted.

Another way that I've deal with this in some of my DCL code is to have the very beginning of the procedure check to see if there is a more recent version of itself and recurse to that version.

I'm attaching an example procedure that illustrates the recursion method.

Robert

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

Re: how to submit a daily job?

Here's an example of a resubmitter procedure that serves as a front end to any procedure that needs to be run regularly.

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

Re: how to submit a daily job?

I just noticed that my RESUBMIT.COM refers to a procedure FINDJOB.

I'm attaching a copy of FINDJOB here in case anybody's interested in actually making the RESUBMIT work.

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Sheldon Smith
HPE Pro

Re: how to submit a daily job?

And, for what it's worth,

$ procedure_file = f$environment("procedure")
$ procedure = f$element(0,";",procedure_file)
$ submit/after="tomorrow+0-08:00:00" 'procedure'

can be reduced down to (the single line)

$ submit/after="tomorrow+0-08:00:00" 'f$element(0,";",f$environment("procedure"))'

As said, make it the first line of your procedure.

Note: While I am an HPE Employee, all of my comments (whether noted or not), are my own and are not any official representation of the company

Accept or Kudo

Davor_7
Regular Advisor

Re: how to submit a daily job?

Thanks all~!
i'll try the easiest way later :)
Sebastian Bazley
Regular Advisor

Re: how to submit a daily job?

Robert Boyd points out that the queue manager stores the command file name by FID.

If you create a new version of the file, and purge the old one before the job has run, queue manager won't find it. Even if the file is renamed to the same version it won't be found.

This has implications for batch scripts that are part of installation kits.

The work-round we used was to create a very simple script that takes its parameters and passes them to the real command file. This is created once if necessary, and never changed.
Karl Rohwedder
Honored Contributor

Re: how to submit a daily job?

Just to add, there is a CRON port for VMS (dated 1991) from a guy called Lance Baily, with some mods from H. Teutsch and myself.

We use it heavily on VAX/Alpha, it is cluster aware. It checks for the crontab entries and starts the jobs using batch.

I do not know, if can be found on the web, but if someone is interested I can make it available.

regards Kalle
Vladimir Fabecic
Honored Contributor

Re: how to submit a daily job?

Karl,
please make it available.
In vino veritas, in VMS cluster
Davor_7
Regular Advisor

Re: how to submit a daily job?

thanks all

btw, Karl
pls let it available :)
Ian Miller.
Honored Contributor

Re: how to submit a daily job?

Karl, if you talk to Hunter Goatley he will host your version of cron.
____________________
Purely Personal Opinion
Karl Rohwedder
Honored Contributor

Re: how to submit a daily job?

I hope I find the time and strip off all
sitespecifics in CRON and create a fairly
easy to install kit any time soon...


regards Kalle
Joseph Huber_1
Honored Contributor

Re: how to submit a daily job?

To add to the list:


There was a DCL based cron on a VMS SIG tape around 1993 by Ulli Horlacher:
http://wwwvms.mppmu.mpg.de/vmssig/archive.c/cron.zip

Another one from NASA, Fortran based:
http://wwwvms.mppmu.mpg.de/vmssig/nasa/kronos2_11.zip

And Karl, I wonder if this cron.c program is the one You mentioned:
http://wwwvms.mppmu.mpg.de/vmssig/src/c/cron.c
?
http://www.mpp.mpg.de/~huber