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

FlatFile schema parsing values

  • 1.  FlatFile schema parsing values

    Posted Thu August 11, 2022 02:55 AM

    Hi,
    I would appreciate your help to solve this issue:
    I have created a flat file schema, which has two records, Header and Data.
    Header has one field EmpNume, where as Data has three fields.

    I am facing difficulty to parse data in both records. I am attaching the pictures regarding my problem:

    and
    image

    this is the schema.
    Now I am going to attach the flow service i’m using to process this schema.


    the pipeline for each step is:
    image

    ![image|666x499](upload://p5jY9XtzaxE1eCkbcMwi0IFBFCy.png

    image
    this is the input i’m parsing, where 12345678 is the EmpNum under header Record…
    after running the flow service i’m getting this error

    I would like your help.
    Regards


    #webMethods


  • 2.  RE: FlatFile schema parsing values

    Posted Mon August 15, 2022 07:00 PM

    Unfortunately, you cannot use the number of fields to determine which type of record a specific line matches. This is, in part, due to the fact that “detail” record could have optional fields at the end – and in that case the count of fields will change and might match a different record type. So you must specify a field in each record that can unambiguously serve as a record type identifier.

    In the case you shared, the file could be:

    H,12345678
    D, Irfan,3500,03214198008
    D, Afzal,1200,03214133188
    D, Asif,1400,03214143188

    With field 1 defined as the record identifier, using ‘H’ for the header record type and ‘D’ for the detail record type. You can use any value desired. The identifier can be a specific field or can be at a specific character positiion.

    If a record identifier is not used (often the case for single record type files) you specify a doc type as the default record type.

    Refer to the service development help for details. HTH.


    #webMethods


  • 3.  RE: FlatFile schema parsing values

    Posted Tue August 16, 2022 01:28 AM

    thanks a lot Reamon
    thats really informative and helpful
    Regards


    #webMethods