How to capture return code from a script and fail the Sequen

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
theone
Participant
Posts: 36
Joined: Tue Oct 06, 2009 10:04 am
Location: Michigan

How to capture return code from a script and fail the Sequen

Post by theone »

I have BTeq script in a routine activity sequence, based on the return value how can I fail the Sequence?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

This might help get you started, that or a search for "bteq". For 'Sequence failure' a link to a Terminator stage is generallly what is needed but there are multiple ways to skin that cat.
-craig

"You can never have too many knives" -- Logan Nine Fingers
theone
Participant
Posts: 36
Joined: Tue Oct 06, 2009 10:04 am
Location: Michigan

Post by theone »

I checked the form and found the syntax

"Call DSExecute('UNIX',Script A,Output,Error)"

I am using following :

Call DSU.ExecSH("/export/ds/xyz/abctest.sh", ErrCode)
If ErrCode <> 0
Then Call DSLogFatal("failed", rtnName)


am i doing the right way?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Where are you doing this? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
theone
Participant
Posts: 36
Joined: Tue Oct 06, 2009 10:04 am
Location: Michigan

Post by theone »

I did that in a custom defined server routine and calling it as before job sub routine
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Before what job? I thought this was all happening in a Sequence job via the Routine Activity stage. Sounds like you are making this more difficult (and more hidden) than it really needs to be. :?
-craig

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