Page 1 of 1

Restarting an aborted job systematically

Posted: Fri Jul 14, 2006 8:31 am
by SWW
Hi,

I am using a control job that sets file parameters and file locations, archives files, and calls four different processes in succession.

I use this piece of code in the control job which will abort the whole process if files are not present and inturn send me an email let me know the status.


if rtncd <> 0 then
Call DSExecute(DSStopJob(XJOBNAMEX), msgs, rtncd)
end

This occurs each weekend because files are not created and every Monday I have to recompile all the jobs to get them ready for that day's processing.

Is there any code I can use or internal process I can flip on to automatically reset the abort to get the job in a ready state?

Thanks in advance

SWW

Posted: Fri Jul 14, 2006 8:40 am
by DSguru2B
Well, IMHO, schedule the process only during weekdays
OR
Right before you start firing your jobs, check for the existence of the files. If they are not there, bypass the execution and elegantly end the process by sending you the email.
If you insist on sticking to your design then you can check the status, if its of status other than 1 or 2 then you can reset it.

Posted: Fri Jul 14, 2006 8:50 am
by loveojha2
Use

Code: Select all

DSRunJob(JobHandle , DSJ.RUNRESET)
Which will reset the job when it is required so.