Page 1 of 1

Datastage Return code

Posted: Mon Jan 16, 2012 1:01 am
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

Posted: Mon Jan 16, 2012 1:04 am
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).

Posted: Mon Jan 16, 2012 2:49 am
by vskr72
Thank you Ray. No wonder you are called the 'Guru'. :)