Excecute command activity

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

Satheesh_Yama
Participant
Posts: 6
Joined: Thu Jul 13, 2006 4:28 am

Excecute command activity

Post 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
Satheesh Y
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post 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)
Satheesh_Yama
Participant
Posts: 6
Joined: Thu Jul 13, 2006 4:28 am

Post 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
Satheesh Y
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is the PATH environment variable correctly set in the dsenv script for DataStage processes?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Satheesh_Yama
Participant
Posts: 6
Joined: Thu Jul 13, 2006 4:28 am

Post 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
Satheesh Y
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Yes you can parameterize the path in Executecommand Activity stage.
And what is the compilation error. Post the error.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Satheesh_Yama
Participant
Posts: 6
Joined: Thu Jul 13, 2006 4:28 am

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

Post by chulett »

Either hard-code the path or use the Parameters box for those parts.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post 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
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Job parameters are not resolved in the Command field. They are, however, resolved in the command parameters (arguments) field.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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:
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Put echo in the command field and #TextToEcho# in the parameter field.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
devnull
Premium Member
Premium Member
Posts: 37
Joined: Wed Mar 29, 2006 11:17 am
Location: Minneapolis, MN USA

Re: Excecute command activity

Post 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]
Michael Mabin
Minneapolis, MN USA
d3vvnull@com.gmail
(Reverse com and gmail to send email)
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

ray.wurlod wrote:Put echo in the command field and #TextToEcho# in the parameter field.
Yes, did the same. :cry:
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply