Page 1 of 1

How to Stop and start a job within a batch ?

Posted: Thu Oct 05, 2006 1:00 pm
by ZamZama
Hello everyone,
I have a scenario and its bogling me.
There is one job that goes and checks a flag in a database which is populated by a user click via a webpage.(not a complex stuff).
That job is specfically selecting on the table in a loop untill the flag exists. And when it does find the flag it does post it to a file. Lets call it JOB A.

I have a Main Job Control from which I am controlling the flow, passing parameters, running jobs, archiving,etc. Also this Main Control Job runs the JOB A before any of the warehouse load is started. Once the flag is captured, within the Main Job I read the content of the flag and accordingly perform various things.

The solution failed, because the JOB A stops running at sometime in the morning consistantly, thus failing the whole process (meain the main control).

What I am thinking is that why not make another batch or a Job sequence(which I have not used at all in my project right now and not really a pro in it) that controls this JOB A and checks its elapsed time that if it is running for 3 hrs then stop it, and then start again after few minutes. This start and stop is going to happen untill the flag is not found.
So once the flag is read, another job deletes the flag and continues the warehouse load. All the said, is controlled through a Control Job (which has list of other jobs loading the warehouse). After load is done, the Control needs to go back and restart the whole process and run JOB A again waiting for the flag to be present.

sheesh.. such a long explanation.
Thanks for bearing with me !

Posted: Thu Oct 05, 2006 1:59 pm
by kduke
Do an exact search for MonitorSeq or monitor job. There are several posts on this topic already.