Page 1 of 1

execute command stage

Posted: Mon Jun 25, 2007 9:44 am
by dspxguy
I am calling a script in the execute command stage and would like to parameterize the path of the shell script.
what is the syntax for it?

Thanks

Posted: Tue Jun 26, 2007 6:11 am
by chulett
:? Just enclose the parameter name in pound/hash/# marks like usual.

Posted: Tue Jun 26, 2007 7:00 am
by kduke
There is a known bug in older versions of DataStage where this does not work. Let us know your version.

Posted: Tue Jun 26, 2007 10:39 am
by dspxguy
7.5.2

Posted: Tue Jun 26, 2007 10:43 am
by chulett
No bug there, so...

Posted: Tue Jun 26, 2007 1:02 pm
by dspxguy
chulett wrote::? Just enclose the parameter name in pound/hash/# marks like usual.
I am getting this error "executable path cannot contain parameters"


In the command field I want to parametrize the path ?
Any advice would be appreciated.
Thanks

Posted: Tue Jun 26, 2007 1:11 pm
by michaeld
You can call the command from within a shell. The input box that takes in the command would execute a command to create a new instance of a shell and the parameters would be the path of the command that you want to run.

I do this in windows. For example if I want to execute c:\var_path\mike.exe where the path is dynamic I would set it up like this.

Command input box:

CMD.EXE

Parameters input box:

/C #jpVarPath#mike.exe #jpParam1# #jpParam2#

Posted: Tue Jun 26, 2007 3:45 pm
by dspxguy
michaeld wrote:You can call the command from within a shell. The input box that takes in the command would execute a command to create a new instance of a shell and the parameters would be the path of the command that you want to run.

I do this in windows. For example if I want to execute c:\var_path\mike.exe where the path is dynamic I would set it up like this.

Command input box:

CMD.EXE

Parameters input box:

/C #jpVarPath#mike.exe #jpParam1# #jpParam2#
Michael my script is in unix box ( /home/folder/filename.sh)
I tried using CMD.sh in command field and in the parameter field #param# which has the whole path of the script , , but it doesnt work.
"Output from command ====>
SH: line 1: CMD.sh: command not found"
Any idea what am I doing wrong here?

Thanks

Posted: Tue Jun 26, 2007 4:02 pm
by chulett
That example was Windows specific. Try using plain old 'sh' instead.

Posted: Tue Jun 26, 2007 4:15 pm
by dspxguy
chulett wrote:That example was Windows specific. Try using plain old 'sh' instead. ...


It worked, Thanks Michael and Chulett..

Posted: Tue Jun 26, 2007 4:53 pm
by ray.wurlod
Please mark thread as Resolved