Unable to execute shell script from DataStage

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
kishore2456
Participant
Posts: 47
Joined: Mon May 07, 2007 10:35 pm

Unable to execute shell script from DataStage

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

Post 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?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kishore2456
Participant
Posts: 47
Joined: Mon May 07, 2007 10:35 pm

Post 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?
FD
vivekgadwal
Premium Member
Premium Member
Posts: 457
Joined: Tue Sep 25, 2007 4:05 pm

Post 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?
Vivek Gadwal

Experience is what you get when you didn't get what you wanted
kishore2456
Participant
Posts: 47
Joined: Mon May 07, 2007 10:35 pm

Post by kishore2456 »

Hi Vivek,

Its the exactly the same user for both executing from shell and datastage job execution. (dsadm).
FD
vinnz
Participant
Posts: 92
Joined: Tue Feb 17, 2004 9:23 pm

Post 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.
Last edited by vinnz on Fri Jul 23, 2010 9:38 am, edited 1 time in total.
Post Reply