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

Schema question for a flat file parsing

  • 1.  Schema question for a flat file parsing

    Posted Wed August 25, 2004 04:54 AM

    Hello all:
    Trying to get some direction on this:

    I am having a problem creating schema for the following TICKET_RECORD flat file:
    H 0 VALIDATION
    Travelwithm Vacations 082520042004000242
    Travelwitnm Vacations 082520042004000418248
    Travelwithm Vtions
    T 0 VALIDATION


    SCHEMA DEFNITION (added space in front of segment id for H and T records

    <SEGMENT ID="H ">
    <POSITION NAME=“RECORD_TYPE” START=“0” LENGTH=“1”/>
    <POSITION NAME=“FILLER” START=“1” LENGTH=“12”/>
    <POSITION NAME=“SECURITY_QUALIFIER” START=“13” LENGTH=“1”/>
    <POSITION NAME=“SECURITY_PASSWORD” START=“14” LENGTH=“10”/>
    <POSITION NAME=“VENDOR_ID” START=“24” LENGTH=“12”/>
    <POSITION NAME=“INTERCHANGE_DATE” START=“36” LENGTH=“6”/>
    <POSITION NAME=“INTERCHANGE_TIME” START=“42” LENGTH=“4”/>
    <POSITION NAME=“TRANSACTION_SET_TYPE” START=“46” LENGTH=“1”/>
    <POSITION NAME=“CONFIRMATIONS_REQUESTED” START=“47” LENGTH=“1”/>
    <POSITION NAME=“TEST_INDICATOR” START=“48” LENGTH=“1”/>
    <POSITION NAME=“NUMBER_OF_RECORDS” START=“49” LENGTH=“5”/>
    </SEGMENT>
    <SEGMENT ID=“recordWithNoID”>
    <POSITION NAME=“WHOLESALER_NAME_CHARACTER” START=“0” LENGTH=“50”/>
    <POSITION NAME=“ARRIVAL_DATE” START=“50” LENGTH=“8”/>
    <POSITION NAME=“RESERVATION_NUMBER” START=“58” LENGTH=“15”/>
    <POSITION NAME=“LAST_NAME” START=“73” LENGTH=“15”/>
    <POSITION NAME=“FIRST_NAME” START=“88” LENGTH=“15”/>
    <POSITION NAME=“TICKET_CODE” START=“103” LENGTH=“5”/>
    <POSITION NAME=“TICKET_DESCRIPTION” START=“108” LENGTH=“10”/>
    <POSITION NAME=“TICKET_QUANTITY” START=“118” LENGTH=“3”/>
    <POSITION NAME=“TICKET_COST” START=“121” LENGTH=“8”/>
    <POSITION NAME=“HOTEL_CODE” START=“129” LENGTH=“30”/>
    </SEGMENT>
    <SEGMENT ID="T ">
    <POSITION NAME=“RECORD_TYPE” START=“0” LENGTH=“1”/>
    <POSITION NAME=“FILLER” START=“1” LENGTH=“12”/>
    <POSITION NAME=“VENDOR_ID” START=“13” LENGTH=“12”/>
    <POSITION NAME=“INTERCHANGE_DATE” START=“25” LENGTH=“6”/>
    <POSITION NAME=“INTERCHANGE_TIME” START=“31” LENGTH=“4”/>
    <POSITION NAME=“CONFIRMATIONS_REQUESTED” START=“35” LENGTH=“1”/>
    <POSITION NAME=“TEST_INDICATOR” START=“36” LENGTH=“1”/>
    <POSITION NAME=“NUMBER_OF_RECORDS” START=“37” LENGTH=“5”/>
    </SEGMENT>
    <SEG-ID>H</SEG-ID>
    <SEG-ID>T</SEG-ID>
    <LOOP Start=“recordWithNoID”>
    <SEG


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


  • 2.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 03:01 PM

    Harsh,

    Please don’t double post. Especially one such as detailed as yours.
    Have your tried setting skipWhiteSpace value to false in convertToValues. Just a thought as I’m unsure of the output.


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


  • 3.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 03:06 PM

    Chris,

    As far i know Harsh is not using WmEDI/convertToValues, he is using some custom made service for parsing.

    And i didnt mentioned in the other post of using the WmEDI services but no details posted about that by him.

    May be he can try to attempt of using this service,if he has WmEDI module installed over there.

    Harsh,please try to maintain the posts which you have created earlier.

    Regards,


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


  • 4.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 03:07 PM

    Chris,

    As far i know Harsh is not using WmEDI/convertToValues, he is using some custom made service for parsing.

    And i did mentioned in the other post of using the WmEDI services but no details posted about that by him.

    May be he can try to attempt of using this service,if he has WmEDI module installed over there.

    Harsh,please try to maintain the posts which you have created earlier.

    Regards,


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


  • 5.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 03:56 PM

    Sorry about the double post Chris:
    I will try the skipWhiteSpace hint.

    Hello RMG:
    Yes I am using the convertToValues service within:
    here is my flow:
    getTemplate
    convertToValues.

    The problem comes in my record structure which has TICKET_RECORD/H(space) or TICKET_RECORD/T(space), the TICKET_RECORD/recordwithNoID values are populated perfectly from the [ouput] of the convertToValues service, and this is because in my schema i had to put segment ID for H and T record with a space, to pull up the appropriate record from the flat file.

    Appreciate the response, thanks

    harsh


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


  • 6.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 04:13 PM

    RMG: i am attaching my flow service and flat file with schema i am running thru this, i tried Chris, suggestion also but i still have the problem.

    Thanks all!
    Harsh

    Scema and flat files
    schema_flatfile.txt (5.9 k)


    test.zip (4.5 k)


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


  • 7.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 04:37 PM

    Harsh,

    If you handling the problem with Space and recordWithNoID loop is working then what is the issue you have?

    you mean when data is there in H/T records then it should overwrite the spaces right and still recordWithNoID loops should work.


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


  • 8.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 04:53 PM

    RMG,

    I think the problem he’s having is with the BRANCH. The schema is fine but he can not BRANCH on "record/H " only on “record/H”.


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


  • 9.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 05:10 PM

    Hello Chris/RMG:
    Thanks for the reply, Yes the problem i am having is when i branch as i now have a space added in the [output] record . "record/H ". So i cannot proceed further. Is there somewhere i can avoid this space and still parse the file properly.
    regards and thanks

    harsh


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


  • 10.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 05:47 PM

    try trimming the recordid field to make it “record/H” and then BRANCH on it.


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


  • 11.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 06:23 PM

    Chris: can you explain in some detail on how i can do that.
    Thanks!

    harsh


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


  • 12.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 06:56 PM

    Use a map statement with trim as a transformer.
    record.recordId ---- trim — record.recordId
    should result in
    "H " —> “H”
    Just map the record back to itself using trim in the transformer step.
    Then you should be able to BRANCH on record.recordId=“H”

    HTH


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


  • 13.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 07:29 PM

    Harsh,

    Chris sugesstion should resolve your problem.
    please try to implement the same way he mentioned.


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


  • 14.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 08:12 PM

    Appreciate the response Chris/RMG but this still doesnt solve the problem:
    This is how my TICKET_RECORD looks like:

    converToValues[OUTPUT]–
    maps—>
    TICKET_RECORD
    |

    • H<space>(HEADER record)
      -string values

    • recordWithNoID (repeating record)
      -string values

    • T<space>(TRAILER RECORD)
      -string values

    The Header gets mapped from output into a H(space), i am not sure how i can use a trim , string transformer to trim a record.
    My branch is for values under H ( header) or T (trailer):
    TICKET_RECORD/H

    regrds,
    Harsh


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


  • 15.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 08:33 PM

    Can you use two different Branch steps one having with H(Space) and the other with no space and similarly for T Record.

    Will this work for you?

    sorry let me also think if anyother options.


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


  • 16.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 08:36 PM

    You’re correct but aren’t you BRANCHing on the field withing the record.
    ie. TICKET_RECORD/H /field


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


  • 17.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 09:05 PM

    RMG: In tried giving TICKET_RECORD/H(SPACE), but this space is not persisted in developer and disappears when i save the change in the branch.

    Chris i finally ended up using Record/H /field to go into the desired sequence.

    Going back to the schema is there a more effcient way to tackle this, i.e records with no id’s having values similar to Header and Trailer segment id?.

    Thanks all for your timely suggestions and ideas, i am going to the next level :-).

    Harsh


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


  • 18.  RE: Schema question for a flat file parsing

    Posted Wed August 25, 2004 11:09 PM

    This is also a good option using Record/H /field to go into the desired sequence.Anyways you got the resolution.

    goodluck,


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


  • 19.  RE: Schema question for a flat file parsing

    Posted Mon April 11, 2005 08:09 AM

    hi,

    I am using convertToValues for a fixed length flat file.
    My input flat file has child records which can appear in any order.
    for example:

    MainRecord…
    childrec1…
    childrec1…
    childrec2…
    childrec2…
    childrec1…
    childrec1…

    i have set ordered=false in my schema. But in the output i am gettting 2 separate doc list for childrec1. I want a single separate doc lists for childrec1 and childrec2. Has anybody faced this problem. Please give me solution for this problem of mine.
    thanks,
    naka


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


  • 20.  RE: Schema question for a flat file parsing

    Posted Mon April 11, 2005 03:02 PM

    Noor,

    Once you have parsed the flatfile you may have to map the seperated doclists what ever childrec1,childrec2 to another single doclists(childrec1),otherwise flatfile schema cannot handle this type of requirement since childrec1 is coming under childrec2.

    May be there is easy way,let c if anyone have another clue to resolve.

    HTH,
    RMG.


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


  • 21.  RE: Schema question for a flat file parsing

    Posted Mon April 11, 2005 03:15 PM

    Hi RMG,

    I expected first reply from you, and u did it!! Thanks for that.
    I thought of this solution, but here, problem is that childrec1 and childrec2 can occur any number of times in any sequence. So at runtime i wont be knowing, how many doc lists of rec1 and rec2 are there.
    Is there any setting in FF schema or convertToValues service, which can be helpful for me??

    regards,
    naka


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


  • 22.  RE: Schema question for a flat file parsing

    Posted Mon April 11, 2005 03:34 PM

    As far i know there is no setting like that in convertToValues,but there might be tricky way in Schema side or outofbox you may have to do some custom processing to build brand new doclists that you are expecting.

    At this moment still thinking if any solution that we are missing.

    Regards,


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


  • 23.  RE: Schema question for a flat file parsing

    Posted Wed June 20, 2007 05:38 PM

    Hi all
    I have an EDI Ansi X12 Document.
    I parse the file using EDIFFSchema. It gives EDIValues which contain the values in ST segment to SE. How do i extract the values in ISA and GS segment ? Is their anyways i can extract those values and put in a document form. Plz help me.

    Thanks
    Stepheny


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


  • 24.  RE: Schema question for a flat file parsing

    Posted Wed June 20, 2007 05:59 PM

    Stepheny,

    You can use the envelopeProcess WmEDI service it gives output a Values document to extract ISA/GS segment data.just pass the edidata input to it.

    HTH,
    RMG


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


  • 25.  RE: Schema question for a flat file parsing

    Posted Wed June 20, 2007 06:06 PM

    Thank u sooooo much for ur instant reply…It worked…
    Thanx for ur support.

    Stepheny


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