Ecxecuting Shell Script in Datastage Jop properties

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
mdtauseefhussain
Participant
Posts: 38
Joined: Mon Feb 27, 2006 10:34 pm
Location: Chennai
Contact:

Ecxecuting Shell Script in Datastage Jop properties

Post by mdtauseefhussain »

HI! All

I have a shell script Sample.sh,when i try to put this script in Exec Sh option in Job properties
iam getting an error
"cannot find Sample.sh

the script is working fine when i run from the particuar folder where the script resid

i tried to execute the script this way

home/staff/thussain/tausif/Sample.sh

when i trie running this scritp in datastage ,iam getting this error

Executed: /home/staff/thussain/tausif/Sample.sh
Reply=0
Output from command ====>
split: No such file or directory
find: cannot read dir ./sot.aOSN: Permission denied
find: cannot read dir ./sowHaOeQ: Permission denied
find: cannot read dir ./sosEaOve: Permission denied

Can any help me executing this script
Mohammed Tausif Hussain Sheikh
Cognizant technologies,Perungudi
Chennai
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Never assume a CWD in scripts. The CWD of any script called from DataStage will be the directory where the project is installed. If you use an absolute path for all references or you change your working directory explicitly inside the script you will be OK
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Similarly, the executing DataStage job assumes that your script is in the project directory if it's not given as a pathname and it's not findable via the PATH environment variable.
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 »

So you need to workout in you script to make sure, the paths refered as the absolute path.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

From the error shown it also means - the script is trying to read/use the directories mentioned int the error message. The user with which you logged in Datastage do not have permissions on directory.

Is the username with which you are loggin in DS and unix is same?
Have you tried executing this script from unix prompt first? It is always a good practice to execute any script on unix that is called from DS jobs.
Regards,
S. Kirtikumar.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Kirtikumar wrote:It is always a good practice to execute any script on unix that is called from DS jobs.
Good practice, yes - but don't make the mistake that just because it runs from the command prompt that it must work fine from a DataStage job! All of the above issues apply that could cause one way to work and the other to not. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

Agreed!!!

Good practice can just reduce the chances of common errors.
Regards,
S. Kirtikumar.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The find command is having permissions problems. You should also verify that the user ID under which DataStage jobs execute have at least r-x permission to all directories in the pathname(s) to be searched.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

Try this

Code: Select all

ksh "YOUR COMMAND, WITH ABSOLUTE PATH"
Post Reply