Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Flat File De-Batching
- This topic has 2 replies, 1 voice, and was last updated 9 years, 1 month ago by
community-content.
-
AuthorPosts
-
-
April 5, 2006 at 5:39 PM #14456
I’m trying to debatch a fixed length flat file with the following format
headerheaderheaderheaderheader
fieldfieldfield[b:f9cd062ba1]X[/b:f9cd062ba1]fieldfieldfieldfield
fieldfieldfield[b:f9cd062ba1]Y[/b:f9cd062ba1]fieldfieldfieldfield
fieldfieldfield[b:f9cd062ba1]Z[/b:f9cd062ba1]fieldfieldfieldfield
fieldfieldfield[b:f9cd062ba1]Y[/b:f9cd062ba1]fieldfieldfieldfield
fieldfieldfield[b:f9cd062ba1]X[/b:f9cd062ba1]fieldfieldfieldfield
trailertrailertrailertrailertrailerThe record files are of different formats in a random order, identifiable by a single character at a fixed position in the record.
I want to be able to split the body records into single messages with headers retained.
Using tag Identifiers and one global schema I was able to output xml or the same format as the input file into a single message but not sure how to debatch.
Any ideas? Thanks in advance.
-
April 7, 2006 at 3:06 PM #14457
Thanks, that seems to have done the trick.
-
-
April 5, 2006 at 10:18 PM #14455
There are a number of options for debatching. You can do it in the pipeline using the Flat File Disassembler or you can do it in an orchestration using the xpath function or XmlDocument code.
To do this in the pipeline you need to declare 3 schemas – Header, Document and Trailer.
The header schema has one positional record with the header fields.
The trailer schema has one positional record with the trailer fields.The document schema is slightly trickier:
[code:1:6719bc8dc1]<schema>
Message (Group Order Type=Choice, delimited, 0x0D 0x0A, Hexadecimal, PostFix)
X(Positional, TagIdentifier=X, offset 15)
<positional fields>
Y(Positional, TagIdentifier=Y, offset 15)
<positional fields>
Z(Positional, TagIdentifier=Z, offset 15)
<positional fields>[/code:1:6719bc8dc1]
You create a custom pipeline with the flat file assembler.
Set the Header, Trailer and Document schema specs and set [b:6719bc8dc1]Preserve Header = True[/b:6719bc8dc1]The pipeline will split the file into multiple messages like <Message><X>…</X><Message>
The header record will be in the message context in the [b:6719bc8dc1]XMLNORM.FlatFileHeaderDocument[/b:6719bc8dc1] property.You can also promote your own properties from the header by adding a property schema to your project adding the required properties (set [b:6719bc8dc1]Property Schema Base[/b:6719bc8dc1] to [b:6719bc8dc1]MessageContextPropertyBase[/b:6719bc8dc1]) and promoting the required properties from the header document.
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.