Page 1 of 2

Excecute command activity

Posted: Mon Aug 07, 2006 12:59 am
by Satheesh_Yama
Hi Dsxians,

Could u please let me know the syntax of calling shell and perl scripts through excecute command activity stage.I have been trying like

sh scriptname and perl scriptname,in command tab.i have no parameters.It is saying command not found.Please help me out in this.

Thanks
satheesh

Posted: Mon Aug 07, 2006 1:24 am
by rameshrr3
Hi you havent mentioned whether you are using the command stage in a job or whether you are using the execute command activity of the job sequencer. If you mean the latter , maybe you can try something like

". /usr/xyz/scripts/commandtoexec.sh" or
sh -c ". /usr/xyz/scripts/commandtoexec.sh"

If A parameter is reqd., you can use sh-c as the command, and can use ". /usr/xyz/scripts/commandtoexec.sh"
as a parameter

Try it out( with and without the preceeding dot (".") and something has to work if it works from the shell invocation)

Posted: Mon Aug 07, 2006 2:26 am
by Satheesh_Yama
Hi ramesh,

Thanks for ur reply.I am using excecute command activity stage in sequencer.Will ur previous commands work here also.do u know how to call the perl scripts.

./dws_edw_javaread.pl is enough or should i use perl dws_edw_javaread.pl, the later is not working for me..Please have ur suggestions.

Thanx
sherin

Posted: Mon Aug 07, 2006 3:06 am
by ray.wurlod
Is the PATH environment variable correctly set in the dsenv script for DataStage processes?

Posted: Mon Aug 07, 2006 4:36 am
by Satheesh_Yama
Hi,

Thanks for ur reply ray.i will make sure that.Could i parametrize a command like this in excecute command activity .

perl #script_path#/dws_edw_javaread.pl(In command tab).Is there any other method as the above one giving compilation error.

Waiting for ur reply.

Thanks
satheesh

Posted: Mon Aug 07, 2006 4:52 am
by kumar_s
Yes you can parameterize the path in Executecommand Activity stage.
And what is the compilation error. Post the error.

Posted: Mon Aug 07, 2006 5:30 am
by Satheesh_Yama
Hi kumar,

If i give this command

perl #script_path#/dws_edw_javaread.pl,in command path

Its giving Excecutable path cannot contain parameters compilation error

Could u please suggest a different method.

Thanx
satheesh

Posted: Mon Aug 07, 2006 6:34 am
by chulett
Either hard-code the path or use the Parameters box for those parts.

Posted: Mon Aug 07, 2006 6:36 am
by rameshrr3
well im calling a perl script in my job, but giving the absolute path. Im also sourcing the environment before running that script( using a shell file full of 'export ENV=$VALUE' commands).

Im NOT using perl - blah blah anywhere. INstead i have a shell script that will invoke the perl script and im executing this shell script.


Thanks
Ramesh

Posted: Mon Aug 07, 2006 8:28 pm
by kumar_s
I did another test for passing parameters for Executecommand activity in Version 7.0 Server edition, as once said by Craig, the value is been passed correctly without any warning or error, but the command is not executed correctly.
But the hardcoded value gives the desired output.

Posted: Mon Aug 07, 2006 10:40 pm
by ray.wurlod
Job parameters are not resolved in the Command field. They are, however, resolved in the command parameters (arguments) field.

Posted: Tue Aug 08, 2006 3:11 am
by kumar_s
Passing parameter in the parameter field also faild in my case with simple echo statement.

echo "DataStage" gives the output, not if "Datastage" is passed as parameter. :shock:

Posted: Tue Aug 08, 2006 6:50 am
by ray.wurlod
Put echo in the command field and #TextToEcho# in the parameter field.

Re: Excecute command activity

Posted: Tue Aug 08, 2006 9:44 am
by devnull
Satheesh_Yama wrote:Hi Dsxians,

Could u please let me know the syntax of calling shell and perl scripts through excecute command activity stage.I have been trying like

sh scriptname and perl scriptname,in command tab.i have no parameters.It is saying command not found.Please help me out in this.

Thanks
satheesh
Make sure the $PATH environment variable of your project includes the directories your commands are in. Or add the $PATH environment variable to your job parameters tab and add the directories you need. You can also source a file that sets environment variables (including PATH) prior to executing your command, like

Code: Select all

 . /home/`whoami`/my_ds_shell_env;perlscript #arg# 
Note the use of the semicolon to stack your commands.[/code]

Posted: Tue Aug 08, 2006 9:35 pm
by kumar_s
ray.wurlod wrote:Put echo in the command field and #TextToEcho# in the parameter field.
Yes, did the same. :cry: