I have an issue to FTP files on remote server.
I am able to FTP files manually using command line sourcing the file from local drive to FTP server.
Files to be FTPed to remote server are on ETL server
DS Routine code
Arg1=' ETL server pathname\FTP.bat'
Command = 'Arg1'
Call DSExecute("DOS", Command, Output, ExitStatus)
Ans=Output
FTP.bat script code
ftp -s:ETL server path\script.txt
script.txt code
open remoteservername
usr
password
cd Outbound
mput ETL server pathname\MZ_FILES_*
quit
Error got while running the routine is
Routine DSU.FTPRoutine did not finish OK, return code = ''Arg1' is not recognized as an internal or external command,'
Any suggestions appreciated
Thanks Paddu
FTP
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Lose the quotes around Arg1.
Code: Select all
Command = Arg1
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
This is hapening in the script itself. Put some strategic echo statements in the script or toggle verbose mode so you can see what's happening, what the values of script variables are, and how far it gets.
You may need to use quote or literal to send specific ftp commands.
You may need to use quote or literal to send specific ftp commands.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
I changed FTP script as below
FileTransfer.bat
@echo off
SET TMP=temp_script
SET REMOTESITE=remoteserver_name
SET USR=username
SET PAS=password
SET OUTFOLDER=/Outbound
SET FILESPATH=ETLserverpath
echo open %REMOTESITE%>%TMP%
echo %USR%>>%TMP%
echo %PAS%>>%TMP%
echo CD %OUTFOLDER%>>%TMP%
echo put %FILESPATH%\Test*>>%TMP%
echo quit>>%TMP%
ftp -s:%TMP%
rm %TMP%
but datastage still gives warning as
Routine DSU.FTPRoutine did not finish OK, return code = 'User (servername.location.company.com:(none)):open FTPservername'
When i checked with the vendor , file was successfully transfered to the remote server .
How can i make sure from datastage standpoint that the routine which runs the bat script did its job successfully ????
Looks like even my previous FTP script also worked but DS routine warning message was misleading ..
Please let me know how to correct my routine .
Thanks
Paddu
FileTransfer.bat
@echo off
SET TMP=temp_script
SET REMOTESITE=remoteserver_name
SET USR=username
SET PAS=password
SET OUTFOLDER=/Outbound
SET FILESPATH=ETLserverpath
echo open %REMOTESITE%>%TMP%
echo %USR%>>%TMP%
echo %PAS%>>%TMP%
echo CD %OUTFOLDER%>>%TMP%
echo put %FILESPATH%\Test*>>%TMP%
echo quit>>%TMP%
ftp -s:%TMP%
rm %TMP%
but datastage still gives warning as
Routine DSU.FTPRoutine did not finish OK, return code = 'User (servername.location.company.com:(none)):open FTPservername'
When i checked with the vendor , file was successfully transfered to the remote server .
How can i make sure from datastage standpoint that the routine which runs the bat script did its job successfully ????
Looks like even my previous FTP script also worked but DS routine warning message was misleading ..
Please let me know how to correct my routine .
Thanks
Paddu
That's because you are returning the output from the command as the status, rather than the status itself. Assuming your routine code still looks as it did in your first post, correct it to look like this:
Test it to ensure it knows when the file transfers properly and test it to ensure it knows when the there are transfer errors, but that should get you alot closer.
Code: Select all
Arg1=' ETL server pathname\FTP.bat'
Command = Arg1
Call DSExecute("DOS", Command, Output, ExitStatus)
Ans=ExitStatus
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers