Datastage Return code

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
vskr72
Premium Member
Premium Member
Posts: 128
Joined: Wed Apr 28, 2004 9:36 pm

Datastage Return code

Post by vskr72 »

We are using datastage 8.5 and I have a script that calls the datastage job. There is no issue calling the job and executing it. But after the sucessful run I am not getting the correct return code. The followiong is the DS job call I have in the script

Code: Select all

        sudo -u dsadm -g dstage ${DSHOME}/bin/dsjob -run -wait -warn 0 -mode NORMAL ${DSProj} ${sDSJobName}
        sDSRetCd=$?
        echo "DS Job run status is  ${sDSRetCd} running ${sDSJobName}.."
Ouput of the code is :

Code: Select all

	Waiting for job...
	Finished waiting for job
	Status code = 0
	DS Job run status is  0 running Month_Job..
I was expecting a retrun code of 1. The job ran fine without any issues. Not sure why the retun code is 0. Is that standard in V8.5
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You need -jobstatus option, not -wait, to have dsjob return the exit status of the job. The -wait option returns only the exit status of dsjob (0 = the job run request was successful).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vskr72
Premium Member
Premium Member
Posts: 128
Joined: Wed Apr 28, 2004 9:36 pm

Post by vskr72 »

Thank you Ray. No wonder you are called the 'Guru'. :)
Post Reply