Page 1 of 1

Option for Job to "Fail" if the "Before Job-R

Posted: Wed Jun 15, 2005 6:28 am
by Sreenivasulu
Hi Guys,


Is there any option for the Datastage job to Fail if the Before Job-Routine
Fails ?


Regards
Sreenivasulu

Posted: Wed Jun 15, 2005 6:38 am
by ArndW
Sreenivasulu,

The before-job routine returns an error-code, if this is non-zero the job will fail.

Posted: Wed Jun 15, 2005 7:10 am
by Sainath.Srinivasan
Make a non-zero return value as the last line in the script - if it fails.

Posted: Wed Jun 15, 2005 3:12 pm
by ray.wurlod
Setting the ErrorCode argument to a non-zero value to stop the job is actually documented in the generated before-after subroutine code. :roll:

Posted: Wed Jun 15, 2005 8:52 pm
by Sreenivasulu
Ray,

I may not be clear in my question.

The before job routine is calling a shell script. The shell script in turn calls a stored procedure.

The paths are parameterized and when the shell script does not find the
path of the storedprocedure it does not generate the log and the
datstage job gets executed. But i do not want the datstage job to get executed if the before-job routine fails.

Regards
Sreenivauslu

Posted: Wed Jun 15, 2005 8:56 pm
by Sreenivasulu
I just found that the header of my message say datastage7.

The issue is in datastage 5.2.2

Sorry for this .

Posted: Wed Jun 15, 2005 8:58 pm
by ray.wurlod
Have the shell script exit with a status code other than 0.

You can detect this with the fourth argument of DSExecute, and set the ErrorCode argument accordingly.

Posted: Wed Jun 15, 2005 9:02 pm
by chulett
Sreenivasulu wrote:I just found that the header of my message say datastage7. The issue is in datastage 5.2.2
Don't worry about it. In this case, that's not an issue - the advice still applies.