Page 1 of 1

Stop a job with status ABORTED

Posted: Thu Jun 23, 2005 4:09 am
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)

Posted: Thu Jun 23, 2005 6:08 am
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,

Posted: Thu Jun 23, 2005 7:14 am
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.

Posted: Thu Jun 23, 2005 5:37 pm
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).