newbie question: strip off trailer of positional flat file

Home Page Forums BizTalk 2004 – BizTalk 2010 newbie question: strip off trailer of positional flat file

Viewing 1 reply thread
  • Author
    • #14878

      You will have problems if you have no tag identifier for each record. The parser does not know when to expect the trailer record.

      You might find it easier to parse the entire message, including the trailer part and remove the trailer using a map.

      • #14879

        You need to be able to identify the records in the file using the Tag Identifier field.
        I have a schema that will parse you example.
        Basically you add a positional Record that is maxOccurs=unbounded and declare each positional field. You can use the \”Allow early termination\” if the last field if the record terminates early.
        After this Record declare another record called EndofFile. Set the Tag Identifier as EOF[space].

        Email me if you would like the schema, it’s too big to post here.

        • #14880


          I am newbie in using BizTalk 2006. I am having issie in receiving a simple positional flat file and strip of the trailer from it for further process.

          The positional flat file format looks like below. Each field has trailing space, if that field value doesn’t take all the length, except the last field which may end with whatever length of data it contains(even less than the predefined field length).

          FieldA1 FieldA2 FieldA3
          FieldB1 FieldB2 FieldB3
          FieldC1 FieldC2 FieldC3

          I defined body/trailer schema and flat file receive pipeline by following Stephen Thomas’s BizTalk 2004 sample, except my case has trailer but no header. However, the parser seems having problem to parse the Body and Trailer schema, and trying to look for further data. From the following error message, it seems the parser keep looking for third line of data, even though I only have single record and one trailer line.

          Thanks in advance for your help,

          There was a failure executing the receive pipeline: \”ABC.BizTalk.Demo.pipeline, ABC.BizTalk.Demo, Version=, Culture=neutral, PublicKeyToken=14e1e338d558d117\” Source: \”Flat file disassembler\” Receive Port: \”TestInboundBatch\” URI: \”C:\\ABC\\TestInboundBatch\\*.*.cms*\” Reason: Unexpected end of stream while looking for:
          Positional data (length is 14)
          The current definition being parsed is Record. The stream offset where the error occured is 240. The line number where the error occured is 3. The column where the error occured is 0.

          • #14881

            Hi Greg,

            Thanks for the response. I did notice that the value of the last positional field in the inbound flat file is shorter than the schema defined. For instance, the last positional field of the Body schema is defined as 30, but the actually flat file data shows only few characters followed by line-feed. I am not sure how the flat file parser interprets it and what schema attributes can do anything about it. I did set \”Allow early termination\” to true, without luck.

            The error indicates the parser doesn’t know when to stop parsiing the Body section of the data. It treats the Trailer as Body section, which cause the pipeline validation failed.

            I tried both single schema mapping and separate Body/Trailer schema ways, but no luck yet. It could be the issue of schema attribute(s) setting. One is using single Positional Flat File schema with both Body and Trailer schema in it, and map to another XML schema file with only Body in it.
            The other is using separate Body and Trailer schema, as well as custom Flat File pipeline. I was able to validate both Body and Trailer instances successfully. However, it error out when I ran through the Receive pipeline.

            It seems either way is fine with inbound file having single record and trailer in it, but not with multiple records in Body section of the file.
            For example:

            1. Inbound file works:
            Filed1a Field1b field1c …

            2. Inbound file doesn’t work:
            Filed1a Field1b field1c …
            Filed2a Field2b field2c …
            Filed3a Field3b field3c …

            Any thought?

            Thanks in advance,

        • #21645

          Hi Greg,

          I’m having the same issue, I’m going tot try and work through your suggestion, but any chnace you still have the sample schema?

          Regards, Jason

          jason dot hyland at gmail dot com

    • #14877

      Thanks Greg. I got that working, finally. 😛
      Thanks again for the help.

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