Page 1 of 1

FTP Issue

Posted: Wed Jun 27, 2007 3:46 pm
by Smeitei
HI

I am running a before job subroutine perl script to FTP and get file from mainframe . I have also put an entry of the user id and password in the .netrc file so that the when the FTP to mainframe is done it doesn't ask for user id/password .

I ran and tested the script manually by running the script but when the script is ran as a before job subroutine from DS job it is failing and giving this issue

*** Output from command was: ***
ftp: ioctl I_PUSH ttcompat: No such device or address
ftp: ioctl(TIOCGETP): No such device or address

Has anyone face this issue

Posted: Wed Jun 27, 2007 7:03 pm
by ArndW
Could it be that the parameters aren't being passed the way you expect when you call the script from DS instead of running it manually? Try hardcoding everything so that the script doesn't use parameters, or perhaps you could echo your parameters in the script to see if that is where your problem lies.

Posted: Thu Jun 28, 2007 6:28 am
by chulett
Perhaps you should post your script?

The vast majority of problems we see where scripts 'run fine' from the command prompt but not from DataStage are where the script writer make too many assumptions about their environment.

Posted: Fri Jun 29, 2007 9:14 am
by Smeitei
problem solved..

.netrc is defined in my home directory and when the ftp runs the unix settins sets the home as / and not home directory so it goes and check for the .netrc file at / instead of checking at home directory . Hence it is not able to pick up userid/password of mainframe server from the .netrc file

Posted: Fri Jun 29, 2007 9:53 am
by chulett
So how exactly did you resolve it? I vaguely recall a way to tell it where to find the .netrc it needs, but wondering specifically what you did for this. Thanks.

Posted: Fri Jun 29, 2007 1:21 pm
by dkmorgan
chulett wrote:So how exactly did you resolve it? I vaguely recall a way to tell it where to find the .netrc it needs, but wondering specifically what you did for this. Thanks.
Typically, one does this by sourcing their user environment at the beginning of the script.