Capturing the Exit Status of a Shellscript and affect DS Job

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
vinay_renu2001
Participant
Posts: 46
Joined: Wed Sep 28, 2005 9:24 am

Capturing the Exit Status of a Shellscript and affect DS Job

Post by vinay_renu2001 »

Hello Everyone,

I have a shell script which is being called in the "Before job sub routine" of a DataStage job. This shell script is on another Server which runs on Linux. Iam calling this script using "SSH" command to connect to the remote server where this script is located.

When this script is executed, I want to capture the exit status of that script. If the exit status != 0 then i want to abort the DataStage job.

This is not happeneing as of now with the current setup. :cry:

To achieve this, do i need to write a routine or do i have any built in process.

Any suggestion is greatly appreciated!!! :)

Thanks

Vinay
Thanks and Regards
Vin
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

I would suggest to use a job sequence.
You could use a Execute Command or embed your shell script in a routine,
Now you can read the ReturnValue and based on that you can Abort your job
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
vinay_renu2001
Participant
Posts: 46
Joined: Wed Sep 28, 2005 9:24 am

Post by vinay_renu2001 »

narasimha wrote:I would suggest to use a job sequence.
You could use a Execute Command or embed your shell script in a routine,
Now you can read the ReturnValue and based on that you can Abort your job
Thanks a lot Narasimha... :D

Fabulous idea!!! Just based on your suggestion my entire process has been changed.

I will keep you posted my progress.

Thanks :)
Thanks and Regards
Vin
Post Reply