Restarting an aborted job systematically

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
SWW
Participant
Posts: 29
Joined: Thu Nov 11, 2004 12:51 pm
Location: Louisville

Restarting an aborted job systematically

Post 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
SWKYDERBY
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

Use

Code: Select all

DSRunJob(JobHandle , DSJ.RUNRESET)
Which will reset the job when it is required so.
Success consists of getting up just one more time than you fall.
Post Reply