DS job aborts..capture status in DS

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
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

DS job aborts..capture status in DS

Post 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
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

Use the function - DSGetJobInfo
Thanks
Deepak Patil

Convince Them Confuse Them .. What's the difference?
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post 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.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

Post 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?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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 */
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: DS job aborts..capture status in DS

Post 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.
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