Page 1 of 1

Query about FTP Adapters- Mercator

Posted: Wed Sep 13, 2006 2:56 am
by bhumika
I m using Mercator 6.7. I want to send several files using FTP adapter.
So in rule bar of map designer, using PUT("FTP",adapter specific commands ) i m able to send files.
Every file is of different names.

Case-1 : Now, for the ftp adapter can i include retry option with some attempts in rule of map designer.
FTP code :
VALID( PUT("FTP",
"-URL FTP://id:pwd@ipaddress//path/Alok/"+filename1+";type=A",
TEXT(FileContents)),
FAIL ( "Error in writing the file to specified directory- (" + LASTERRORCODE ( ) + "): " +
LASTERRORMSG ( )))

Case-2 : If i use the FTP adapter in output card settings of map designer or in IFD, then can i send files having different names.
eg : -URL FTP://id:pwd@ip address//path/Alok/filename;type=A
The above filename is not the same everytime.

Posted: Thu Sep 14, 2006 3:12 am
by janhess
The PUT function with FTP adapter does not return diagnostic messages very well. It is best to run a map with the adapter.
I usually run a map that has 1 input card and 1 output card both using a blob of data.
The command is

Code: Select all

=run("ftpadapter",echoin(1,data to ftp ) + " -OAFTP1R3:5 '-AUDIT+ -PT -T+ -URL ftp://"  + User + ":" + Pword + "@" + IPadd +  "/" + Destination + ";type=ASCII+" 
 + " -MKD'")
If you just want to pass the name of the file to the run map you could use

Code: Select all

=run("ftpadapter","-IF1file name -OAFTP1R3:5 '-AUDIT+ -PT -T+ -URL ftp://"  + User + ":" + Pword + "@" + IPadd +  "/" + Destination + ";type=ASCII+" 
 + " -MKD'")
The R3:5 is the retry 3 times every 5 secs.
The filename in destination can be changed along with the input file name.

Posted: Mon Sep 25, 2006 12:45 am
by bhumika
Thanks Janhess... It is working perfectly..

Posted: Tue Sep 26, 2006 1:11 pm
by rodneycrowe
I disagree with the information regarding the usefulness of the PUT () function. I think that you can get useful debugging information with put by invoking similar to the following.

=VALID(PUT("FTP", "adapter commands", data), LASTERRORCODE() + LASTERRORMSG())

RUN() returns a return code for the execution of the run map.

My $.02

Posted: Wed Sep 27, 2006 3:50 am
by janhess
The comment regarding the put function came from Ascential (now IBM) support so they should know.

Posted: Thu Oct 05, 2006 8:09 am
by bhumika
Hi,
The specific probs which i was facing related to FTP adapters was solved using RUN function. The PUT along with adapter commands is not working specific to my issue.
Now, i encountered another bad issue in the same.
Many times while connecting to target application i m getting the below message in FTP Trace file. I am retrying FTP for 2 times

Attempt #1 failed, will retry after 40 second delay.
WSASend: Socket error 32 occurred (There is no process to read data written to a pipe.).
Attempt #2 failed, will retry after 40 second delay.
WSASend: Socket error 32 occurred (There is no process to read data written to a pipe.).


After 1st attempt , a socket error comes. FTP waits for 40 secs and i m getting the attempt 2 failure in the very next line. Means FTP adapter is not trying to again open the url , login etc...
Pls give your comments. I could not find any thing more in Mercator to explore abt it.

In mercator.ini we have a settings like Idle, Soft Limit (SLim), Hard Limit (HLim). Changes these for FTP can help ? Pls provide your inputs on it.

Thanks in Advance.

Posted: Thu Oct 05, 2006 8:30 am
by janhess
try IdleFTP=10 in mercator.ini but it may be the connection is unavailable.

Posted: Thu Oct 05, 2006 2:02 pm
by jvmerc
Keep in mind that a failed ftp connection (not a failed ftp) is not immediatly killed. It still needs to idle out. So, any ftp that is executed while a failed connection is idle will fail if it attempts to use that connection.

(i think that made sense)

Posted: Fri Oct 06, 2006 3:48 am
by bhumika
Hi,
Thanks for the immediate reply.

1)
Using Run function , I tried increasing the retry attempts and time interval ( 4:100 secs ) but still getting the same probs.

2)
Now, In mercator.ini file IdleFTP=0 ( default). I will change to IdleFTP=20 and try it. Logically in mercator once a ftp fails, connection chks for FTPidle time. Once idle time is the connection gets close. Now the adapter trys to again open a connection and give another attempt based on time factor in retry option.
Correct me , if i m wrong. I am not very much sure abt it.

I will update soon after changing IdleFTP to 20.

3)
Is there any thing in mercator more to R&D in this matter.

Thanks