Page 1 of 1

How to make this condition in Job Sequence Restartability

Posted: Mon Nov 24, 2008 9:47 am
by pradkumar
Hi Everyone,

I have a job that releases several jobs to run concurrently . In those 2 jobs failed one with an abort and other has warning messages. But in my sequence i do not proceed to next step .Next step is on OK,the alternate link is "otherwise". On re-start of the job , excecution started from the 1st job which is OK, but i wanted 2nd job to restart also and it didn't.

I did not check the box "Do not check point run" because I don't want it to re-run even if it successfully finishes, only when it "fails" with warning.

Can anyone help me to overcome this problem and what approach have to follow for this ..

Thanks in Advance

Posted: Mon Nov 24, 2008 10:43 am
by chulett
Your Sequence job must abort and be in an Aborted/Restartable status in order for the checkpoints to work... was it?

Posted: Mon Nov 24, 2008 12:50 pm
by pradkumar
yes the sequence job is in aborted/restartable status.Is it possible to set a condition the job should restart if it has warining/abort?

Posted: Mon Nov 24, 2008 1:06 pm
by chulett
Oh, so the issue is the one that ended with warnings does not rerun? Your jobs need to Abort as well, so you'll need to ensure it aborts as well whenever there are any warnings in it.

Posted: Mon Nov 24, 2008 1:40 pm
by pradkumar
yes Chulett.. I need to abort the job when ever it has got warnings. Can you please tell me how to do this in job level or sequencer level.

Thanks

Posted: Mon Nov 24, 2008 2:07 pm
by chulett
Sequence level would be too late, so you need to handle it "in job". Several ways, some off the top of my head...

Set the warning level when the job runs very low. Send problems down a reject link set to abort on the first record. Check the JOBINTERIMSTATUS after job and abort the job if is says it's going to finish with warnings.

Probably others.

Posted: Mon Nov 24, 2008 4:57 pm
by pradkumar
Thanks for your answers. I will try to use to those conditions and let you know.

Posted: Mon Nov 24, 2008 9:53 pm
by pradkumar
Hi,

Can i use the terminator activity stage in the job sequence and the trigger option would be DSJ.JOBSTATUS = DSJS.RUNWARN.?

Can i use this option ..Please let me know

Posted: Tue Nov 25, 2008 12:25 am
by chulett
No, anything at that level would be too late. That would abort the Sequence itself and possibly any currently running jobs as well, not the one that ended with warnings.

Posted: Tue Nov 25, 2008 3:15 am
by parag.s.27
chulett wrote:No, anything at that level would be too late. That would abort the Sequence itself and possibly any currently running jobs as well, not the one that ended with warnings. ...
We also had same problem and we resolved it.

Write an After Stage Subroutine and in that routine check for job status using DSJ functions. If the status is not equal to one then issue a fatal signal as DSLogFatal(<any message>,<name of routine>)

and the job will abort after throwing your custom message

Posted: Tue Nov 25, 2008 9:52 am
by pradkumar
Hi Parag,

Can you help me how to write or give an idea for after job subroutine to solve this issue.. Because iam new for the routines .I need to write parallel routine right?





Thanks in Advance

Posted: Tue Nov 25, 2008 1:53 pm
by ray.wurlod
Not true. Before/after subroutines are written as server routines whose type is "before/after subroutines", even when they are deployed into parallel jobs. This works because before/after subroutines only ever have to execute on the conductor node, and (typically) the conductor node is where the DataStage run machine is installed.

Posted: Tue Nov 25, 2008 1:56 pm
by ray.wurlod
DSXchange Learning Center has a DVD available on programming with the DataStage BASIC language. Or you can take a class

Posted: Tue Nov 25, 2008 4:42 pm
by pradkumar
Thanks Ray for you answers. I will be writing the routine and i will let you know if i have any questions.