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
srekant
Premium Member
Posts: 85 Joined: Wed Jan 19, 2005 6:52 am
Location: Detroit
Post
by srekant » Sat Jan 21, 2006 7:29 am
hi,
how to execute shell script from a basic routine.
I have a routine is doing a string comparision after that i want to execute a shell script.
How can i achieve this
Sree
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Sat Jan 21, 2006 8:16 am
Check your online help for the DSExecute command. This can be used to run operating system commands, including scripts.
-craig
"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Posts: 5227 Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:
Post
by kduke » Sat Jan 21, 2006 11:33 am
I would not call a routine. I would:
Code: Select all
Cmd = 'SH -c "MyShellScript.sh param1 param2"'
execute Cmd capturing Output returning RtnValue
Mamu Kim
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Sat Jan 21, 2006 3:44 pm
...which is pretty much what DSExecute does.
Kim's reasoning probably has to do with the stripping of quote characters. But he didn't say.
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Sat Jan 21, 2006 4:27 pm
Perhaps Ken will explain his reasoning. Oh sorry... perhaps Kim will explain his reasoning.
-craig
"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Posts: 5227 Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:
Post
by kduke » Sat Jan 21, 2006 9:47 pm
This is just more direct. Too many layers inside calling another routine when it is just 2 lines of code. Keepin it simple smarty.
Mamu Kim
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Sun Jan 22, 2006 1:25 pm
Surely, then, keeping it even more simple would be to use ExecSH as a before/after subroutine or to invoke the command from an Execute Command activity?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Posts: 5227 Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:
Post
by kduke » Sun Jan 22, 2006 2:13 pm
I would agree with that.
Mamu Kim