Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

batch job to run every day automatically.

shiva27
Frequent Advisor

batch job to run every day automatically.

Can u pl. help someone.
How can I set up a batch job to run every day automatically.
Ex.Monday 06:00 , Tuesday 06:00 and so on...

OpenVMS:V7.3-2.

I tried to run the job as below command but it ran only one day.
$Submit/log=xyz/noprint/keep/AFTER="TODAY+1-06:00" ABC.com;
11 REPLIES
Robert Gezelter
Honored Contributor

Re: batch job to run every day automatically.

Shiva,

This topic reappears every few months in the ITRC Forum.

While they are dated, doing a search on prior threads for "openvms daily batch job" points to a prior Forum thread at http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1229483623254+28353475&threadId=960315 as well as an Ask The Wizard item entitled "Periodic Rescheduling of Batch Jobs" at http://h71000.www7.hp.com/wizard/wiz_2585.html

For a start, I have supplied pointers rather tban reproducing the entire discussion.

- Bob Gezelter, http://www.rlgsc.com
John Gillings
Honored Contributor

Re: batch job to run every day automatically.

shiva,
the job has to resubmit itself. Here's a sample:

symbols may be defined elsewhere
$ queue="queue name"
$ after="time to run"
$ log="log file name"
$ params="/PARAMS=(p1,p2,p3...)"


$ self=F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))
$ IF "''log'".NES."" THEN log="/LOG=''log'"
$ IF "''after'".EQS."" THEN after="TOMORROW+6:00" ! Default run time
$ IF "''queue'".EQS."" THEN queue=F$GETQUI("DISPLAY_ENTRY","QUEUE_NAME",,"THIS_JOB")
$ IF "''queue'".NES."" THEN queue="/QUEUE="+queue
$ SUBMIT/KEEP/NOPRINT 'self' /AFTER="''after'" 'queue' 'log' 'params'


You should perform this early in the procedure so that errors or premature exits don't break the chain of jobs.
A crucible of informative mistakes
shiva27
Frequent Advisor

Re: batch job to run every day automatically.

Hi John,

Thanks for your help. Is it there any easiest way to resubmit the job everyday itself.If you provide the command it will helpful.
Hein van den Heuvel
Honored Contributor

Re: batch job to run every day automatically.

Shiva,

Please READ and study the help provided.

No there is no standard single command OUTSIDE the procedure to accomplish this.

But you can put the line you used as the first line in the job itself and that will take care of care.. in a coarse way.

John's help, and the other topics, will provided a more refined solution, but it still needs to be included into the job itself.

If there are many jobs to manage, then some folks/companies opt to write a 'super script' to submit other scripts will all features like repeat interval and protection against multiple submits. If you want to go that route, then I would encourage you to investigate commercial schedule tools.
One example, but certainly not the only one, could be JAMS.

Cheers,
Hein.



Joseph Huber_1
Honored Contributor

Re: batch job to run every day automatically.

In addition to programming the resubmit(-time) into every scheduled job DCL code, there are implementations of the Unix-like "cron" features on the freeware collections.
Look for CRON or KRONOS files/directories.
http://www.mpp.mpg.de/~huber
shiva27
Frequent Advisor

Re: batch job to run every day automatically.

Thanks all for help.

Issued has been fixed.
Jan van den Ende
Honored Contributor

Re: batch job to run every day automatically.

Shiva,

>>>
Thanks for all help
<<<

So, please read

http://forums1.itrc.hp.com/service/forums/helptips.do?#33

about HOW to say thanks in these forums.

Proost.

Have one on me.

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

Re: batch job to run every day automatically.

Shiva,
Since I don't see any error in your command, I wonder how you fixed the problem.
Regards --- Teofil
Hein van den Heuvel
Honored Contributor

Re: batch job to run every day automatically.

Teofil,

The is no error in the command, but it is just a single shot command submitting ABC.com for tomorrow.

It has to be moved into ABC.com to make it resubmit it self. The command can be copied just as it is, or dressed up a little with F$ENV("PROCEDURE") and stuff like that to make is more manageable.

fwiw,
Hein.

Re: batch job to run every day automatically.

Hein,
Ic.
I've always wondered why submit hasn't got qualifier like /REPEAT with or w/o some keywords.
Thanks for your reply.
Regards --- Teofil
Robert Gezelter
Honored Contributor

Re: batch job to run every day automatically.

Teofil,

While I have never worked for OpenVMS Engineering, I suspect that "Repeat at interval" was not done for a variety of reasons, one of which is that including the SUBMIT command in the command file is straightforward.

It is true that rescheduling precisely (and I mean "precisely") the same job could be done by merely adding a delta time field to the queue record, many, many repeating jobs are not so simple. Often parameters, both as inputs to the job, and to the job controller, vary in many ways. It is not easy, and may be impossible, to embrace all of the desired variability.

- Bob Gezelter, http://www.rlgsc.com