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

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
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

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

Post by Sreenivasulu »

Hi Guys,


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


Regards
Sreenivasulu
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Sreenivasulu,

The before-job routine returns an error-code, if this is non-zero the job will fail.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Make a non-zero return value as the last line in the script - if it fails.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post 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
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

I just found that the header of my message say datastage7.

The issue is in datastage 5.2.2

Sorry for this .
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

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