Hi,
We have a problem using FTP in DataStage. We created a script that uses the .netrc file to connect automatically to a remote FTP server.
The macro definition creates a new directory on the FTP server and looks like:
macrodef ftpmkdir
mkdir newdir
bye
However, when executing a script in DataStage containing the following text:
echo "\$ ftpmkdir" | ftp servername
we receive the following output:
Name (main-labotest.vmm.be:dsadm): User dsadm cannot log in.
Login failed.
When executing this script in command line on the local server the script runs successfully.
Does anyone have some experience using FTP in DataStage (not using the FTP Stage)?
Kind regards,
Kristine
Calling FTP script within DataStage
Moderators: chulett, rschirm, roy
.netrc and macros can be disabled on the target server. If any shell script works at the command line and not within DataStage DSExecute or ExecSH is either a permissions problem or a environment variable issue. All DataStage jobs run as phantoms and do not execute the .profile so your UNIX environment is different. The .netrc is only for a specific user. If you want then post your whole shell script and please change the passwords and server names or ip addresses. Please use code tags before and after.
Mamu Kim
Hi,
Usually I prefer to build a FTP script on the fly and remove it after I'm done.
IHTH,
Usually I prefer to build a FTP script on the fly and remove it after I'm done.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
-
- Participant
- Posts: 8
- Joined: Tue Dec 13, 2005 4:14 am
Script content
.netrc filekduke wrote:paste code
Code: Select all
machine [i]servername[/i]
login [i]login[/i]
password [i]password[/i]
macdef ftpmkdir
mkdir $1
bye
macdef ftpremovedir
rmdir $1
bye
Code: Select all
ftp [i]servername[/i]
$ ftpmkdir $1
Code: Select all
. /path/mkdir.sh [i]newdirectory[/i]
scriptfile mkdir.sh
If you can pipe into ftp then do the whole thing that way.
Does not look right. What is the $ on line 2. In your first post you said this was the command:ftp servername
$ ftpmkdir $1
Code: Select all
echo "\$ ftpmkdir" | ftp servername
Code: Select all
ftp $1 <<!
user password
mkdir $2
bye
!
Mamu Kim
-
- Participant
- Posts: 8
- Joined: Tue Dec 13, 2005 4:14 am
It should work on both ways (AIX help)
kduke wrote:scriptfile mkdir.shDoes not look right. What is the $ on line 2. In your first post you said this was the command:ftp servername
$ ftpmkdir $1Code: Select all
echo "\$ ftpmkd ...[/quote] the $ on line 2 points at the macrodef in out .netrc file in the home dir of the dsadm user However it doesn't work on both ways: 1) "echo "\$ ftpmkd .." 2) ". mkdir.sh newdir" with within the script: ftp servername <enter> $ ftpmkdir $1 Our AIX help does tell us that this are the two ways the automatic ftp-login / script should work.
Re: It should work on both ways (AIX help)
I would first make sure the script works outside of DataStage running under the user that would execute the DataStage job.
If you can get it to work like that the problem you're having with DataStage is an "integration" problem.
So can you already make it work outside of DataStage? If it doesn't it's probably more of an AIX support question.
Ogmios
If you can get it to work like that the problem you're having with DataStage is an "integration" problem.
So can you already make it work outside of DataStage? If it doesn't it's probably more of an AIX support question.
Ogmios
In theory there's no difference between theory and practice. In practice there is.