Repeating records issue.

Home Page Forums BizTalk 2004 – BizTalk 2010 Repeating records issue.

Viewing 1 reply thread
  • Author
    Posts
    • #16700

      Hi,

      I created a project to read flat file and store the data into table. It works fine when I have one Purchase order in the flat file. When I have more than one purchase order, it is not working.

      I think my flat file schema is wrong. could any one help me to fix it?

      for example, the following flat file could store in to db.

      Header01 45566 CISCO USA
      Detail01 01 888 AAA  AAAAA DDDDDD
      Detail01 02 876 CCCC CCCC  CCCCC
      Detail01 03 766 AAAC GGGG AAAAA

      Here I define the Detail Node's Max Occure for undbound. So it works fine. My Header node's max occure is blank.

      When I use something like following, my project fails to handle it.

      Header01 45566 CISCO USA
      Detail01 01 888 AAA  AAAAA DDDDDD
      Detail01 02 876 CCCC CCCC  CCCCC
      Detail01 03 766 AAAC GGGG AAAAA
      Header01 45567 CISCO USA
      Detail01 01 888 AAA  AAAAA DDDDDD
      Detail01 02 876 CCCC CCCC  CCCCC
      Header01 45568 CISCO USA
      Detail01 01 888 AAA  AAAAA DDDDDD
      Detail01 03 766 AAAC GGGG AAAAA

      See in this case I have 3 purchase orders.

      How can I handle this kind of case? So I want my schmea to handle when more than one purchase order in the flat file.

      Siva

    • #16710

      I think the easiest way would be to debatch the file into 3 separate files.  I really have 3 files in one.  You can do this using an envelope but probably would require a 2nd pass through BizTalk.  You could also use an Orchestration to break up the message once you have it in XML.

       

      You could probably also change your schema to support multiple files by adding a higher level root record.  But in this case you’d need to redo your maps.

      • #16716

        thank you,

        I fixed it, Now i have another issue:

        The error is:
        Unexpected DataFound while looking for:
        'D01'
        '\r\n'
        'S01'
        The current definition being parsed is POInfo. The stream offset where the
        error occured is 3675. the number where the error occured is 16. the column
        where the error occured is 0.

        The D01 is repeating record. The next record type is S01. I have 4 D01
        lines. The next line is S01. why is it still looking for D01?
        The D01's Max Occured set as "Unbounded". I can have it as much as I have.
        How can i make schema to stop looking for D01 and go to next S01 element?
        I am new to XML Schema, Please help me to fix this issue.

        • #16718

          To parse the whole file into one message with multiple documents you need a schema like this, the child order is critical:

          root (hex 0x0D 0x0A postfix)
          –document (hex 0x0D 0x0A infix maxOccurs=*)
          —-header (positional tag=Header01)
          ——fields
          —-details ((hex 0x0D 0x0A infix)
          ——detail (positional tag=Detail01 maxOccurs=*)
          ——–fields

          To debatch into separate document messages in the pipeline, change the maxOccurs of the document node to 1

          • #16725

            Thank you for your help.

             when I dont have optional filed Why is it create xml above that field level and skipping the rest?

            for example.. if I dont have H02 ( which is optional) in my flat file, then xml created about HO2. So I am losing D01, D02 which are under the H02 in the schema and flat file.

             

            • #16736

              One other thing to look at is the parsing modes.  There is Speed and Complexity.  When you have optional nodes you usually need to change the setting to Complexity.  It’s set on the <schema> node.

              • #16773

                Thank you Stephen.

                It works now.

                I have another issue. Is it possible to have duplicate tags in the Flat file Schema?

                In my case  I have D02 ( Detail 02) line in the header level and the detail level. Both of them have different information.

                I tried to avoid the tag for one of the D02 but it didnt work.  My tag can not be more then 3 charactors since customer name start at 4th position in D02. I have other lines starting with D01 and D03 so I dont think  I can use "D" or "D0" as tag. Is there any way to solve my problem?

                I can not make any changes in input flat files. So I have to handle this case in schema level.

                Thank you

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.