Job status...return value...stange problem...

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
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Job status...return value...stange problem...

Post by kaps »

I have a strange problem. We run the Datastage jobs from a scheduling tool using unix script. Few of my jobs failed due to No space left on device problem but it looks like status sent to scheduling tool is (0) success. The actual status is failed.

Does anyone faced such problem ? Does it return any other code when the job fails for space reason ?

we check the status of the job using the following command
dsjob -run -jobstatus $prmStr $prm_project $prm_job
Following steps are done afterwords...
Getting end event ID
Sending the log to a file
Check the status and exit
Is there any other way I need to check for jib status ?

Please let me know...
[/quote]
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

dsjob -jobinfo $prm_project $prm_job
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Post by kaps »

Ray

First job did not run but the scheduler moved on to next job which failed because the input file was not there. First job is the one which failed because of the space issue. But later we reran the jobs to completion.
So now If I check the status it will give me the return status of success.

I am trying to figure out why it was sending success last night even though it was in the failed status. is there a way we can check the job status of previous run ?

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

With the -jobstatus option, a return value of 1 is 'success', not zero. An abort would have returned a 3. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Post by kaps »

Craig

It's just a mistake. we are actually looking for 1.
Following is the code we are using...

Code: Select all

Run_Stat=`dsjob -run -jobstatus $prmStr $prm_project $prm_job 2> /dev/null`
Run_Stat_Val=`echo $Run_Stat | head -1 | cut -d"(" -f2 | cut -d")" -f1`

if test $Run_Stat_Val -eq 1
then
Ret_Val=0
 echo "DataStage Job $prm_job ran successfully" >> $Script_LogDir/$Script_LogFileName
else
Ret_Val=$Run_Stat_Val
 echo "DataStage Job $prm_job failed...Aborting the script" >> $Script_LogDir/$Script_LogFileName
fi



rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post by rleishman »

Do you need a -wait to wait for a result?
Ross Leishman
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Nope, the -jobstatus option includes the -wait, no extra charge.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply