Need help with Executing shell script

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

Need help with Executing shell script

Post by theone »

I have a complex stored procedure I created shell script to call it on unix box. I'm little confused how to integrate the script in job properties to run it after the job.

This is what I did:

In After -job subroutine I selected ExecSH and provided the script path as /export/home/project/shell.sh


I want to know is that the right process, if not can I know the right way.

Thank you.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's certainly *a* right process and how you would do it 'after job' as part of the job in question. Another option would be to use a Sequence job to first run the job and then use an Execute Command stage to run the script as a separate action after the job completes.
-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 can try that, that raised one more doubt. If I have multiple scripts can I do like this way: "/export/home/project/shell.sh; /export/home/project/shell2.sh"
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sure, the normal syntax for executing multiple commands applies. You might want to use "&&" rather than ";" as the former is conditional, an error stops anything after that running.
-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 »

thanks for your reply
Post Reply