IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Parsing of Flat File

  • 1.  Parsing of Flat File

    Posted Wed April 09, 2008 09:26 AM

    Hi,

    I am facing problem in parsing a flat file.
    I have two kind of records in one Flat file.
    One type of records is a continous string without any space or delimiter and where as the other type of records are seperated by a seperator ~(tilda)

    I am not getting the way how to parse this file using schema.


    #edi
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Parsing of Flat File

    Posted Wed April 09, 2008 02:29 PM

    As said above,can you upload your flatfile sample,so that users here will take a look and respond.

    HTH,
    RMG


    #Integration-Server-and-ESB
    #webMethods
    #edi


  • 3.  RE: Parsing of Flat File

    Posted Thu April 10, 2008 04:55 AM

    There are two type of records in file

    first one is like

    1004200811042008ABCDEF123456
    Second record is like
    10042008~11042008~ABCDEF~123456

    First record is without any seperator and the second record is with the ~ separator.

    Let me know if any other info required.


    #edi
    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: Parsing of Flat File

    Posted Thu April 10, 2008 02:44 PM

    You cannot create schema/parse this kind of file…one record with out segment delimiter and second record with segment delimiter etc…all in one file…In FlatFileDefinition itself you can’t specify record parsers with 2 various delimiters,it should be the same parsing criteria for all the records.

    So talk to your source people who created this file and let them know to give file the way webMethods can parse it.

    HTH,
    RMG


    #edi
    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: Parsing of Flat File

    Posted Fri April 11, 2008 07:14 AM

    Thanks a lot for your response…
    can i use two different schema to parse one file?


    #webMethods
    #edi
    #Integration-Server-and-ESB


  • 6.  RE: Parsing of Flat File

    Posted Fri April 11, 2008 04:42 PM

    First thing …u need to follow what RMG said , to make sure source system is ready to change the file layout , to make it easy on your part ( i dont know how much effort is required on their part to do that)

    I dont think u could do 2 schemas and work on same fiel, i dont know if the first line and the second line are related or are those completly different records.

    if they are completly different records , then what u can do is u need to split the incoming file into two files one which contains all the records with no delimeter and one with delimeters( u may need to write a java service which works on the file :- as a preprocessing step).

    once the 2 files are created , u can then use your processing to work on 2 files( create 2 schemas and the reguar stuff).

    Note :- the above solution should be used only when the source system is not ready to change the way they are sending the file ( As RMG mentioned)

    HTH
    sri


    #webMethods
    #edi
    #Integration-Server-and-ESB


  • 7.  RE: Parsing of Flat File

    Posted Fri April 18, 2008 05:19 PM

    If you cant get your source to give you a consistent string, can you employ some Perl or java code that monkeys with the first record, adding ~ where needed?

    If you note an ISA record, it is a set length, and your translator/ediModule gets the expected delimiters from that. You could use that same logic to recognize a string of a specific bite size and insert ~ where needed. Then let the convert to values take it from there.

    Its bad Mojo to try to clean up a source systems data and then process within WM. From a business clarity point of view, your source should be specific and consistent.


    #Integration-Server-and-ESB
    #edi
    #webMethods


  • 8.  RE: Parsing of Flat File

    Posted Mon April 21, 2008 08:52 PM

    My suggestion if you can’t have the source file modified is to create a couple
    of java services, one for each record (line) type you have in the file.
    Then, you read the line in a standard non-delimited way. Then, pass it to
    which ever service is appropriate. You could even have a java service that examines the line for a ‘~’ char to help determine which service will process the line. This way, you can just go around the file schema and you’d be done a lot faster.

    _brett.


    #edi
    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: Parsing of Flat File

    Posted Thu May 15, 2008 09:24 AM

    Thanks a lot guys for your valuable comments


    #Integration-Server-and-ESB
    #edi
    #webMethods


  • 10.  RE: Parsing of Flat File

    Posted Sat May 24, 2008 12:06 PM

    As you said :
    first one is like
    1004200811042008ABCDEF123456
    Second record is like
    10042008~11042008~ABCDEF~123456

    You may replace ‘~’ with empty, and try to use one schema to solve this issue.


    #Integration-Server-and-ESB
    #edi
    #webMethods