Page 1 of 1

DS job aborts..capture status in DS

Posted: Thu Sep 27, 2007 2:54 pm
by ds_is_fun
If my DS Server job aborts how do I capture the status? I want ideally want to capture the status into a column in transformer stage. Thanks1

Posted: Thu Sep 27, 2007 3:04 pm
by DeepakCorning
Use the function - DSGetJobInfo

Posted: Thu Sep 27, 2007 3:05 pm
by narasimha
You will have to do this in two seperate jobs. Capturing the abort status of the job in the one of its transformers will not be possible.

First job - Write the return code in to a file.
Second job -Read the return code from the file to get the status of the job.

Posted: Fri Sep 28, 2007 10:43 am
by ds_is_fun
I think we need the filehandle, Infotype as -
DSGetJobInfo(DSJ.ME,DSJ.JOBSTATUS)
When job runs successfully value is 0. what are other numbers?

Posted: Fri Sep 28, 2007 11:07 am
by chulett
From $DSHOME/include/dsapi.h -

Code: Select all

/* 'jobStatus' values... */

#define DSJS_RUNNING            0       /* Job running */
#define DSJS_RUNOK              1       /* Job finished a normal run with no warnings */
#define DSJS_RUNWARN            2       /* Job finished a normal run with warnings */
#define DSJS_RUNFAILED          3       /* Job finished a normal run with a fatal error */
#define DSJS_VALOK              11      /* Job finished a validation run with no warnings */
#define DSJS_VALWARN            12      /* Job finished a validation run with warnings */
#define DSJS_VALFAILED          13      /* Job failed a validation run  */
#define DSJS_RESET              21      /* Job finished a reset run */
#define DSJS_CRASHED            96      /* Job was stopped by some indeterminate action */
#define DSJS_STOPPED            97      /* Job was stopped by operator intervention (can't tell run type) */
#define DSJS_NOTRUNNABLE        98      /* Job has not been compiled */
#define DSJS_NOTRUNNING         99      /* Any other status */

Re: DS job aborts..capture status in DS

Posted: Fri Sep 28, 2007 4:12 pm
by ray.wurlod
ds_is_fun wrote:If my DS Server job aborts how do I capture the status? I want ideally want to capture the status into a column in transformer stage. Thanks1
If the job aborts, it's aborted. You can't capture anything in the job - it's already aborted.

You must test the status in the job sequence that runs the job, using a trigger, or using the DSGetJobInfo() function from a separate routine. Do not use DSJ.ME for the job handle in the latter - generate a job handle by invoking the DSAttachJob() function. When done don't forget to use DSDetachJob() to free the handle and the job lock.