FTP

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

FTP

Post by paddu »

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
Last edited by paddu on Fri Feb 08, 2008 5:06 pm, edited 1 time in total.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

Thanks ray for quick response

After changing as you suggested ,now the error is

Routine DSU.FTPRoutine did not finish OK, return code = 'User (servername.location.company.com:(none)): open FTPserver'

servername in the error is not ETL servername . Does this make anysense??

Sorry for using aliases..
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

i will try this on monday.

I have restricted window on weekends :|
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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:

Code: Select all

Arg1=' ETL server pathname\FTP.bat' 
Command = Arg1
Call DSExecute("DOS", Command, Output, ExitStatus) 
Ans=ExitStatus
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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

Thanks for your suggestions chulett .Will try and update here
Post Reply