calling shell script form datastage

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
coehcl
Charter Member
Charter Member
Posts: 16
Joined: Tue Oct 10, 2006 8:42 am

calling shell script form datastage

Post by coehcl »

hi all,
i am having some problem when i am calling a shell script form datastage.
i have a shell script which is in /home/devinput.
name of the shell script is "test.sh" now i am calling this shell script from job properties "before job subrutine".In "before job subrutine" drop down box i am selecting "ExecSH" and in the input value box i am giving the entire path with the shell script name "/home/devinput/test.sh" but this is not working .do i need to set some other parameter or do i need do my requrement in some other way?

thanks in advance
baglasumit21
Participant
Posts: 132
Joined: Wed Mar 01, 2006 11:12 pm
Location: Pune

Re: calling shell script form datastage

Post by baglasumit21 »

coehcl wrote:hi all,
i am having some problem when i am calling a shell script form datastage.
i have a shell script which is in /home/devinput.
name of the shell script is "test.sh" now i am calling this shell script from job properties "before job subrutine".In "before job subrutine" drop down box i am selecting "ExecSH" and in the input value box i am giving the entire path with the shell script name "/home/devinput/test.sh" but this is not working .do i need to set some other parameter or do i need do my requrement in some other way?

thanks in advance
This may be the problem of permission. For the script file you need to set the access rights i.e. chmode = 777 so that it can be accessed through the user id by which you have logged in to datastage.
SMB
coehcl
Charter Member
Charter Member
Posts: 16
Joined: Tue Oct 10, 2006 8:42 am

Re: calling shell script form datastage

Post by coehcl »

baglasumit21 wrote:
coehcl wrote:hi all,
i am having some problem when i am calling a shell script form datastage.
i have a shell script which is in /home/devinput.
name of the shell script is "test.sh" now i am calling this shell script from job properties "before job subrutine".In "before job subrutine" drop down box i am selecting "ExecSH" and in the input value box i am giving the entire path with the shell script name "/home/devinput/test.sh" but this is not working .do i need to set some other parameter or do i need do my requrement in some other way?

thanks in advance
This may be the problem of permission. For the script file you need to set the access rights i.e. chmode = 777 so that it can be accessed through the user id by which you have logged in to datastage.
Thanks for the replay but i have already given all the permissoion to the shell script.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Does the script execute from command line ? Try giving

Code: Select all

sh /home/devinput/test.sh
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

Make a step by step approach to the use.

Start with something like "ls >abc.txt" and continue step by step.

Remember the User on Unix directly may be different to the one in DataStage (most time dsadm).

Compare if it is both the same shell.

Maybe you have to execute a sh before.

By step-by-step you may get your right result.
Wolfgang Hürter
Amsterdam
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You might also want to elaborate on what your problem is. Saying "this is not working" doesn't help us help you. What's not working about it? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
urshit_1983
Participant
Posts: 73
Joined: Wed Jun 28, 2006 3:27 pm
Location: NJ

Post by urshit_1983 »

First of all check your shell script if its executing properly, I mean you getting desired output by using >sh filename.sh.

If your script is correct then change the mode of file by:

>chmod 777 filename.sh

After this open DS and select the Before or After job subroutine

In the input values write : cd ;#Directorypath#/filename.sh

Try to run and check it should be fine

Let me know if there is still problem
"Nobody is expert in Everything,
But Everybody is expert in Something."
Post Reply