Microsoft KB Archive/914590

= The flat file output may not contain the flat file delimiters as expected in BizTalk Server 2006 and in BizTalk Server 2004 =

Article ID: 914590

Article Last Modified on 5/3/2006

-

APPLIES TO


 * Microsoft BizTalk Server 2006 Standard Edition
 * Microsoft BizTalk Server 2006 Enterprise Edition
 * Microsoft BizTalk Server 2006 Developer Edition
 * Microsoft BizTalk Server 2004 Standard Edition
 * Microsoft BizTalk Server 2004 Developer Edition
 * Microsoft BizTalk Server 2004 Enterprise Edition
 * Microsoft BizTalk Server 2004 Partner Edition

-





SYMPTOMS
In Microsoft BizTalk Server 2006 and in Microsoft BizTalk Server 2004, the flat file output may not contain the flat file delimiters as expected. This behavior may occur when you process a message by using a custom pipeline that contains the Flat File Assembler pipeline component.

For example, if the message that the custom pipeline processes contains a missing record, the flat file output may not contain the flat file delimiters. The flat file delimiters may not appear in the output file depending on the position of the missing record in the input file.



WORKAROUND
To work around this behavior, use a map and a custom scripting functoid to make sure that an empty record is created when the input file does not contain the record. To do this, follow these steps:  Set the following properties on the potentially empty nodes in the document schema for the Flat File Assembler pipeline component:  Set the Preserve Delimiter for Empty Data property to the Yes value. Set the Suppress Trailing Delimiter property to the No value. On the root node, set the Generate Empty Nodes property to the True value.  Add a new map to the BizTalk project. In this map, use the document schema for the Flat File Assembler pipeline component as the source schema and as the destination schema. In the map that you created in step 2, map the source fields that are not empty to the corresponding destination fields.</li>  For the fields that may be empty in the input file, use a scripting functoid to return an empty string when the record is missing. The following code example for the scripting functoid demonstrates how to do this. public string ValOrEmpty(string val) {    return (val.Length > 0) ? val : &quot;&quot;; } Note You must create a script that has a unique function name for each potentially empty field that you map. For example, if you have three potentially empty fields, you may have functions that are named the following:  The ValOrEmpty1 function</li> The ValOrEmpty2 function</li> The ValOrEmpty3 function</li></ul> </li></ol>

<div class="status_section">

STATUS
This behavior is by design.

Keywords: kbtshoot kbprb kbcode kbbts KB914590

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.