Query about FTP Adapters- Mercator

Formally known as "Mercator Inside Integrator 6.7", DataStage TX enables high-volume, complex transactions without the need for additional coding.

Moderators: chulett, rschirm

Post Reply
bhumika
Participant
Posts: 7
Joined: Wed Sep 13, 2006 2:40 am

Query about FTP Adapters- Mercator

Post 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.
janhess
Participant
Posts: 201
Joined: Thu Sep 18, 2003 2:18 am
Location: UK

Post 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.
bhumika
Participant
Posts: 7
Joined: Wed Sep 13, 2006 2:40 am

Post by bhumika »

Thanks Janhess... It is working perfectly..
rodneycrowe
Participant
Posts: 10
Joined: Fri Sep 23, 2005 10:27 am

Post 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
janhess
Participant
Posts: 201
Joined: Thu Sep 18, 2003 2:18 am
Location: UK

Post by janhess »

The comment regarding the put function came from Ascential (now IBM) support so they should know.
bhumika
Participant
Posts: 7
Joined: Wed Sep 13, 2006 2:40 am

Post 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.
janhess
Participant
Posts: 201
Joined: Thu Sep 18, 2003 2:18 am
Location: UK

Post by janhess »

try IdleFTP=10 in mercator.ini but it may be the connection is unavailable.
jvmerc
Participant
Posts: 94
Joined: Tue Dec 02, 2003 12:57 pm

Post 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)
bhumika
Participant
Posts: 7
Joined: Wed Sep 13, 2006 2:40 am

Post 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
Post Reply