Capturing the Exit Status of a Shellscript and affect DS Job

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
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
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I am not sure you can directly because ssh needs to return it to DataStage. Just try it and let us know. ExecSH has a return value. You can also use execute ... capturing ... returning ...

I would search for these.
Mamu Kim
Post Reply