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
  • 1.  Parsing multiple record Flat Files with/without delimiters

    Posted Tue April 22, 2003 08:06 AM

    Does anyone know how to parse a flat file that has multiple record types and some of the records types have field delimiters and some are fixed length.

    For example: A Purchase Order (PO)

    Header id = 001 and holds Purchase number & date and each field is fixed length
    Shipper id = 002 and holds address information, each address field is delimited by a | character.

    Sample data:

    0018521252003/04/22
    002ShipperNumber|ShipperName|ShipperAddress
    0018528882003/04/22
    002S852|John Brown Shipping|123 West Drive

    My thought is to parse the flat file twice, once with a fixed length schema just pulling out the Headers and then again with a character delimited schema. The only issue I have is matching the data together afterwards.

    Any ideas?


    #webMethods
    #webMethods-General
    #Integration-Server-and-ESB


  • 2.  RE: Parsing multiple record Flat Files with/without delimiters

    Posted Tue April 22, 2003 08:50 AM

    I got this to work in one pass by setting up a delimted FF schema with “newline” as the record delimiter, and “|” as the field delimiter.

    I set up a schema with “001” as the record Identifer for the fixed length lines, and used a Fixed Position Extractor. Set Max Repeat to unlimited.

    The second record was set up with “002” as the record identifer, and was set up as child of the first record, and Max Repeat was left at “1”. Use a Nth field extractor for this.

    The problem that occurs is that the 002 records have no delimiter between the record identifier (002) and the first data element, so the first data element must have the “002” stripped off to be usable.

    I have a sample .zip file. If you would like to obtain the zip file or discuss this further, contact me at pjewell@webmethods.com

    Best Regards,
    -Phillip


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-General


  • 3.  RE: Parsing multiple record Flat Files with/without delimiters

    Posted Wed May 26, 2004 03:53 PM

    Has anyone worked with multiple character record delimiters? such as ‘END’ representing the end of a record. I have yet find the documentation within webMethods as it appears that all delimiters are limited to one character position.

    Thanks,

    Adam


    #webMethods-General
    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: Parsing multiple record Flat Files with/without delimiters

    Posted Thu May 27, 2004 05:51 PM

    Adam:

    I would create a Flat file dictionary with a Record defined for Record definition and field definition.

    After that I would create a Flat file schema and point the setting to reference the dictionary you created earlier.

    Test the schema.

    Generate the document.

    You will need to write extensive tokenizer code to performing parsing.

    Good luck!

    Regards,
    Animesh


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 5.  RE: Parsing multiple record Flat Files with/without delimiters

    Posted Wed June 02, 2004 01:30 PM

    I appreciate your assistance, but that does not really answer the question. I could tokenize it without the WmFlatFile package.


    #webMethods-General
    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: Parsing multiple record Flat Files with/without delimiters

    Posted Fri June 10, 2005 06:36 AM

    Hi,
    Present iam working in webmethods4.6 version.iam trying to separate fields in flatfile records using string tokenizer but some records have no fields in flafile.So if i excute the service this error is coming “java.lang.NullPointerException”.So tell me where iam going to wrong and how can i solve this problem.
    with regards,
    venkat


    #webMethods
    #webMethods-General
    #Integration-Server-and-ESB


  • 7.  RE: Parsing multiple record Flat Files with/without delimiters

    Posted Mon June 13, 2005 11:06 AM

    Hello,
    Adam: You could use the replaceString service and turn all multi-char delimeters into single-char ones. Then you can use the more common tools.

    Venkat: You should use a branch to test if certain fields are $null. You would then set then to some useable default value. I see this a lot when you try to get a numeric value and pass it to the math services. Good day.

    Yemi Bedu


    #webMethods-General
    #webMethods
    #Integration-Server-and-ESB


  • 8.  RE: Parsing multiple record Flat Files with/without delimiters

    Posted Tue May 23, 2006 08:59 PM

    No one ever answered the question about multiple character delimiters. I am well versed in using the Flat File adaptor in WM 6.0.1. The delimiter is " <$> ", but the adaptor stops on “<”.

    I am using replaceString service, but this is 1000’s of extra executions, and I am trying to make this long running program more efficient.

    Help?!?!?


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods