Stop a job with status ABORTED

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
Sant
Participant
Posts: 15
Joined: Thu May 12, 2005 12:08 am

Stop a job with status ABORTED

Post by Sant »

Hi everybody

I use a master which run all job with a ini file.
For the run first job, I must verify that the last loading has finish with a status OK (I don't have line with 'IN PROGRESS' but 'FINISHED') in the table named 'REPORT'

When I run the first job of the project, I read the nexval number sequence, and other parameters for write in 'REPORT' the new loading.

I don't how do that.

Thank you for your help.

Frederic from Paris (France)
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
If I undesrtand you, you want to check if the last run finished successfully otherwise you want the job to abort.

So do a sequence job.
Th first job activity should be one that reads from your REPORT table and searching for the finished flag.
If you don't find it use the DSLogFatal() ( not recommended but only ) this will get your job to aborted status, otherwise you might ba able to use DSStopJob(DSJ.ME) to sop the job.
after this simply trigger your logic acording to the job activity's status.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Another method would be to use a Routine activity from a sequencer before re-calling your job "x"; in there use the DSGetJobInfo("x",DSJ.JOBSTATUS) to get the last run's status, return that code to the sequence and decide upon the action to do there.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Or set ErrorCode to a non-zero value in a before-job subroutine that checks the exit status of the previous job.

Or set it up with appropriate triggers in a job sequence (preferred).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply