Hi All,
I have a current Process that runs "windows script " for the file movement that needs to changed to a "DataStage Process (Using shell script )"
Source :Text file is getting generated as part of Datastage Jobs processes and resides in a shared drive (Unix server)
Target :ftp hostname "xxx.yyy.com " folder "ABC" is a mailbox location
Current Process :
Currently It is using following windows script to move the file
open xxx.yyy.com
user name
password
prompt
put "\\psoft8\output\FILE.TXT"%ABC%FILE
quit
Can you please help me with FTP command OR syntax used for this file movement.
Thank you
\\psoft8
looks like a samba (SMB) windows file share. In order to open that file on UNIX you have to install samba. So, something is missing. You can ftp from windows to UNIX, no problem.
So instead of showing us a code fragment that is of very little help:
- Is this from windows to UNIX?
<your answer here>
- Can it (the ftp part at least) run on Windows or does the script have to live on UNIX?
<another answer please>
- Can the UNIX box see
\\psoft
(or whatever its name is on UNIX, maybe /psoft8
) now? <yes or no>
@Jim ..Thanks for the reply sorry for the confusion.
[\\psoft8]this is the windows server and Is OBSELTE NOW .. the proposed process is to place the file from unix server to Mail box location ftp server .
Responses :
- Is this from windows to UNIX?
No ..this is from unix server to mail box location (ftp host)
- Can it (the ftp part at least) run on Windows or does the script have to live on UNIX?
Script has to be reside on UNIX server ..Script has to be executed from DataStage Execute command Activity stage ..This stage takes the "FTP.sh " and Properties for the script.
- Can the UNIX box see \\psoft (or whatever its name is on UNIX, maybe /psoft8 ) now? <yes or no>
No ..\\psoft is OBSELTE now
This is basic script I wrote to get the file from that mail box server
#!/usr/bin/bash
#------------------------------------------------------------------------------------
# Name : FTP.sh
#---------------------------------------------------------------------------------------------------------------------------#
HOST= 'xxx.yyy.com'
user ='aaaa'
password='bbbb'
ftp xxx.yyy.com
user $user $password
get 00123456789
quit
END_SCRIPT
Exit 0
Findings from Windows command prompt :
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\X>ftp xxx.yyy.com
Connected to xxx.yyy.com.
220 Enterprise FTP server (Version 1.0.0 Nov. 5, 1996)
User (edi.cat.com:(none)): aaaa
331 Password required for aaaa
Password:
230-User logged in, proceed.
Current Default Relationship - Recv: aaaa uuuu: *BINARY
Get option: multiple
230
ftp> dir
200 Port command successful.
150 Opening ASCII mode data connection for transfer
Mailbox ID St APRZ SYRF Service Refs. #
abc N SMAR file123 00123
abc N SMAR file456 00456
226 Transfer Complete.
ftp: 2319 bytes received in 0.04Seconds 52.70Kbytes/sec.
ftp> get SMAR
200 Port command successful.
150 Opening ASCII mode data connection for transfer
226- 30 documents are received
226 Transfer complete.
ftp: 28687325 bytes received in 35.06Seconds 818.17Kbytes/sec.
ftp> lcd
Local directory now C:\Users\X.
ftp> get file321
200 Port command successful.
226- 0 documents are received
226 Transfer complete.
ftp> get 00123
200 Port command successful.
150 Opening ASCII mode data connection for transfer
226 Transfer complete.
ftp: 962245 bytes received in 0.31Seconds 3144.59Kbytes/sec.
ftp>