IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  FTP Adapter

    Posted 11/02/09 08:46 AM

    Originally posted by: anthcorr


    Hello,

    I'm trying to use the FTP adapter with wildcards in the filename but I'm facing to an issue. When several files are available and matching to the filename (with *, ex : *.txt), all the files are downloaded at the same time.

    My question is, is there a way to download the files one by one instead of all at the same time ?

    Thank you.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 2.  Re: FTP Adapter

    Posted 11/02/09 09:02 AM

    Originally posted by: repanzer


    This used to be in the documentation;

    Have a map with your FTP as the input card, but do TYPE=D. This will return each filename available on the FTP site. Then pass each filename one by one to a functional map, and in the F map, do a “Blob To Blob” Run map, overriding the input with the FTP info, including the filename you just got with the TYPE=D.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 3.  Re: FTP Adapter

    Posted 11/04/09 07:13 AM

    Originally posted by: anthcorr


    Thank you for the replies and the solution.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 4.  Re: FTP Adapter

    Posted 11/10/09 05:13 AM
      |   view attached

    Originally posted by: anthcorr


    Hello,

    I've tried the solution proposed but I'm facing to a little issue.

    First, I tried to test this solution using a map with 1 input card that will get the list of the files and one output card that will treat this list of files to get each file one by one. It correctly worked.

    But, after this, I had to adapt this map to get the list of the files with an output card instead of an input card, and this is where I have an issue. I've made a functional map to get the list of the files but it seems the result of the functional is not correctly applied or interpreted by the type tree (the same as the one used by the input card in the first map). All the files are in the same "block".

    See an example of my problem :

    With Map 1 (with list of files got from the input card) :

    The map is connecting to the FTP to get the list of the files

    
    URL FTP:
    //test:*****@localhost/wtx/*.*;type=D will be used. [WSAStart: Entering] [WSAStart: bWSStarted = 0, nWSClients = 0] [WSAStart: Attempting WinSock initialization.] [WSAStart: WinSock initialized successfully.] Windows Sockets Version 1.1 will be used. Windows Sockets Version 2.2 is supported. Windows Socket Description is 
    'WinSock 2.0'. Windows Socket System Status is 
    'Running'. Windows Socket supports up to 32767 socket(s). Windows Socket supports UDP datagram of up to 65467 bytes. Windows Socket has no additional vendor-specific information. Sockets Client ID 1 enabled. [WSAStart: Exiting (rc = 1)] URL user: 
    'test'. URL pass: 
    '****'. URL host: 
    'localhost'. URL port: 
    '21'. URL path: 
    'wtx/*.*'. URL type: 
    'D'.
    


    Then each file is download one by one.

    
    Options used: trace,verbose,append,name,url URL FTP:
    //test:*****@localhost/wtx/tata.txt;type=A will be used. Using C:\DOCUME~1\ACORRA~1.LUT\LOCALS~1\Temp\B5D.tmp as tempfile. URL user: 
    'test'. URL pass: 
    '****'. URL host: 
    'localhost'. URL port: 
    '21'. URL path: 
    'wtx/tata.txt'. URL type: 
    'A'. Using ftp: protocol. Setting AIX/UNIX-specific parameters. <PWD   >257 
    "/wtx" is current directory. (S) <TYPE A   >200 Type set to A (S) <PASV   >227 Entering Passive Mode (127,0,0,1,35,178) (S) Using port 
    '9138' 
    
    for the connection. Connecting to 
    '127.0.0.1'. Socket Opened. Connected. <NLST tata.txt   >150 Connection accepted (S) >tata.txt Socket Closed.
    


    Same code for all other files.

    With Map 2 (with the list got from the output card) :

    The map lists correctly the files as the first map does but when it should download the files one by one, I have the following :

    
    Fetch Unit is 0.  Card Mode is Integral. Run Started at 11:08:59.781 on 11/10/09. Options used: trace,verbose,append,name,url URL FTP:
    //test:*****@localhost/wtx/tata.txt   test.txt   titi.txt   toto.txt   ;type=A will be used. Using C:\DOCUME~1\ACORRA~1.LUT\LOCALS~1\Temp\B62.tmp as tempfile. URL user: 
    'test'. URL pass: 
    '****'. URL host: 
    'localhost'. URL port: 
    '21'. URL path: 
    'wtx/tata.txt   test.txt   titi.txt   toto.txt   
    '. URL type: 
    'A'. Using ftp: protocol. Setting AIX/UNIX-specific parameters. <PWD   >257 
    "/wtx" is current directory. (S) <TYPE A   >200 Type set to A (S) <PASV   >227 Entering Passive Mode (127,0,0,1,35,187) (S) Using port 
    '9147' 
    
    for the connection. Connecting to 
    '127.0.0.1'. Socket Opened. Connected. <NLST tata.txt   test.txt   titi.txt   toto.txt   >150 Connection accepted (S)
    


    All the files are in the same element of the typetree, instead of one file by one element...
    I think I have made a little mistake with my functional map but I can not find it. Could someone help me please ?

    I have attached the source code of these 2 maps.

    If you need more explanation of my problem, just request it because I'm not sure I've been very cleared.

    Thank you very much !
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender

    Attachment(s)



  • 5.  Re: FTP Adapter

    Posted 11/10/09 02:22 PM

    Originally posted by: repanzer


    "But, after this, I had to adapt this map to get the list of the files with an output card instead of an input card"

    Why are you doing this? You said it worked, right?

    I don't have a solution, because I would always get the list of filenames by having an input FTP card with type=D. When I do, it returns the filenames seperated by a carriage return/line feed (on windows, LF on Unix), so I have that input card defined as a file with blob(s), and the blob has a terminator of CR/LF (LF on Unix).

    Just an fyi, on windows, the line break is carriage return/line feed. On unix/linux, it's just a line feed, but WTX has "NL", which is New Line, which will be CR/LF when the map is running on windows, and just LF when running under linux/unix.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 6.  Re: FTP Adapter

    Posted 11/02/09 09:06 AM

    Originally posted by: Kepa_Screen


    What you need to do is to create several output cards, sink.
    You must use "*" wildcard at input.
    In one of them you get a list of files

    =/*Hacemos un "ls -l" de Unix para tener informacion del ficehro a transferir*/
    GET("FTP", "-URL FTP://"(USER_FTP)":"+(PASSWORD_FTP)
    +"@"+(MAQUINA)
    +"/"+(DIRECTORIO_ORIGEN)
    (LS_Normal Fields:Fichero_origen)";type=D2")

    Here you have a list of all files at host "MAQUINA", at dir "DIRECTORIO_ORIGEN" and LS_Normal Fields:Fichero_origen would be "*".

    Then use that list to retrieve files one by one.

    LS_Extendido Fields:Salida+
    GET("FTP", "-URL FTP://"(USER_FTP)":"+(PASSWORD_FTP)
    +"@"+(MAQUINA)
    +"/"+(DIRECTORIO_ORIGEN)
    +(LS_Normal Fields:Fichero_origen))
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender