Page 1 of 1

Unable to execute shell script from DataStage

Posted: Fri Jul 23, 2010 4:16 am
by kishore2456
Hi,

I'm able to execute a shell script from shell which would connect to a windows server through telnet and executes set of commands and exits.

however, when i call this script from DataStage using either execsh or Execute command the script doesn't run completely. Its running till the password prompt and returns saying connection closed by foreign host. The message actually returns after exiting from the telnet connection.

telnet> Trying x.xx.xx.xxx...
Connected to xxxxxxxxxxx.
Escape character is '^]'.
Welcome to Microsoft Telnet Service

login: domain\user
password:

Please advice.

Posted: Fri Jul 23, 2010 5:17 am
by ray.wurlod
Some telnet clients do not allow passwords to be redirected. Check whether this is the case for your telnet client. Does your script include a "here script" for the telnet session?

Posted: Fri Jul 23, 2010 6:35 am
by kishore2456
Ray,

Thanks for the reply.

I'm echoing the password ( i believe it is here script). Though the script is successful while running from shell manually, from datastage I'm unable to execute the script successfully.

If the my telnet doesn't accept the password in such way, it shouldn't have accepted the script while running manually, right?

Posted: Fri Jul 23, 2010 8:39 am
by vivekgadwal
kishore2456 wrote:Though the script is successful while running from shell manually, from datastage I'm unable to execute the script successfully.
Which Id did you use to run the script manually? I am thinking probably it has something to do with the environment DataStage sets (it sets a static environment with the dsenv). I mean, no matter who you submit the job as, the dsadm id is what runs it. So, can you check on the permissions on this and rule this possibility out?

Posted: Fri Jul 23, 2010 8:57 am
by kishore2456
Hi Vivek,

Its the exactly the same user for both executing from shell and datastage job execution. (dsadm).

Posted: Fri Jul 23, 2010 9:36 am
by vinnz
Is there anything specific in your .profile that allows your script to be executed manually? I am not sure if your profile is sourced when you kick off any script through ExecSH. You may have to add some environment variables to dsenv. People here may be able to help a bit more if you posted your script.