webMethods

webMethods

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

recordWithNoID

  • 1.  recordWithNoID

    Posted Thu May 08, 2014 09:49 AM

    Hi,

    How can I build a ffschema to parse this ff?

    HEAD 234626 fgsdhsh - 1-1,Ok to identify using HEAD
    165484 ashrhsh - 1-1 no identifier, but I know how it will look like and its mandatory in the file.
    123564 gsertse - 1-1 no identifier, but I know how it will look like and its mandatory in the file.
    LINE AA BB CC - 1-many,Ok to identify using HEAD

    The problem is that the second and third row do not have a identifier and I dont know how to use different recordWithNoID?

    /J


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 2.  RE: recordWithNoID

    Posted Thu May 08, 2014 10:16 AM

    Hi Joh,

    are lines 2 & 3 of fixed length?

    Thanks,
    Rankesh


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 3.  RE: recordWithNoID

    Posted Thu May 08, 2014 10:38 AM


  • 4.  RE: recordWithNoID

    Posted Thu May 08, 2014 10:44 AM

    Hi Joh,

    is second/third line like 0-6 is one filed[165484], 8-15[ashrhsh] is other field?

    Thanks,
    Rankesh


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 5.  RE: recordWithNoID

    Posted Thu May 08, 2014 10:51 AM

    Hi,

    Yes different fieldd, but the thing is that second/third row do not use the same field structure, thats why I cannot use a recordWithNoID since you can only have one recordWithNoID that uses the same fields. Correct?

    regard Joh


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 6.  RE: recordWithNoID

    Posted Thu May 08, 2014 11:00 AM

    Joh,

    You are correct, In these type of structures you need handle some part of data throuh code.

    Note: To handle through code, I would suggest to confirm file structure & proceed further and make sure use logic the logic correctly and also use iterator, if file is big

    Thanks
    Sai


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 7.  RE: recordWithNoID

    Posted Thu May 08, 2014 11:17 AM

    Hi Joh,

    I got it, 2&3 lines are different in structure.

    Can you please take 2-3 sample files and count the number of characters in 2 line and let us know?

    If line2/3 is not of fixed length then you have to:
    Split the file in 3 parts, 1. HEAD 2. Sandwiched data 3. LINE
    HEAD and LINE are easy to handle as they have identifiers.

    The tough job is to process Sandwiched data. You need to identify a pattern and come up with logic.

    HTH.

    Thanks,
    Rankesh


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 8.  RE: recordWithNoID

    Posted Thu May 08, 2014 11:23 AM

    I think joh is giving sample of only two line, in case if he is getting more than 2 line. I would suggest to use iterator

    We have handled these type of file(having two recordWithNOID structures) using iterator & through code, once developer have good understanding in pattern of data


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 9.  RE: recordWithNoID

    Posted Thu May 08, 2014 11:42 AM

    Hi Joh,

    Procedure:

    1. define a record and define its field with appropriate length [in case it is fixed] More in Dict.png
    2. In schema definition set the dictionary. More in schema.png
    3. get the data in result. More in result.png

    HTH.

    Thanks,
    Rankesh



    result.PNG


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 10.  RE: recordWithNoID

    Posted Fri May 09, 2014 04:51 AM

    Hi,

    Rankesh, I dont think its possible to do it your way since the structure of row 2 and 3 are different and the record delimiter is newline. HEAD, LINE and TOTAL are easy to handle I agree.

    See attatched testfile.
    row 2:
    pos 0-5 header
    pos 5-12 text1
    pos 12-28 text2
    pos 28-53 num1
    pos 53-55 text3

    row3:
    pos 0-5 header
    pos 5-17 num1
    pos 17-34 num2
    pos 34-38 num3

    Any suggestion how to code this custom convertToValues service?

    I appriciate your help, thanks!
    ff_testfile1.txt (286 Bytes)


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 11.  RE: recordWithNoID

    Posted Fri May 09, 2014 07:06 AM

    Hi Joh,

    I will get back to you.

    Thanks,
    Rankesh


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 12.  RE: recordWithNoID

    Posted Fri May 09, 2014 09:17 AM

    Hi Joh,

    I have written a crude code, which is not for production use. You need to modify and use ffiterator, if required. Please take help of attached code and improvised over it.

    HTH.

    Hi Sai,

    Please add your inputs to improve the attached code.

    Thanks,
    Rankesh
    FFTechCommunity.zip (27.3 KB)


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 13.  RE: recordWithNoID

    Posted Wed May 14, 2014 04:41 AM

    Hi,

    Rankesh, this is a nice solution.

    Thanks,
    Joh


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 14.  RE: recordWithNoID

    Posted Wed May 14, 2014 11:30 AM

    Thanks for more and more getting utilities handy and helping the wM user community. :smiley:

    -RMG


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 15.  RE: recordWithNoID

    Posted Thu May 15, 2014 05:01 AM