how execute script from my basic routine

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
srekant
Premium Member
Premium Member
Posts: 85
Joined: Wed Jan 19, 2005 6:52 am
Location: Detroit

how execute script from my basic routine

Post by srekant »

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
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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

Post by kduke »

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 »

...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
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Perhaps Ken will explain his reasoning. Oh sorry... perhaps Kim will explain his reasoning. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

:)

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 »

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

Post by kduke »

I would agree with that.
Mamu Kim
Post Reply