Posted by: techsavygal | March 16, 2006

Flat File Debatching in BizTalk Server 2006!

Hi All,

In the ug session yday, i covered the topic on how to use Flat File Schema Wizard and create flat files in BizTalk Server 2006. In this session, i heard few interesting questions and doubts and would like to document them here.

Before we proceed to document the documents, lets have brief look at the Flat File schema Wizard and what led Microsoft to create one!

Q.What is Flat File Schema Wizard?

Flat File Schema Wizard is introduced in BTS 2006 to simplify the process of creating of flat file schemas by providing the following:

  • Ability to view the entire flat file message and select parts of the message
  • Visual Design interface to create delimited and positional flat file schemas
  • Interactive process to add child records,repeating records and related annotations.

Q. What were the problems before Flat File Schema Wizard was introduced?

A. Stephen Thomas has listed out the pros and cons of Flat File Debatching (Pipeline debatching) and Orchestration Debatching in his blog.Apart from those pros and cons, some more are listed in Lee’s Blog.

Getting started with Flat File Schema Wizard in BTS 2006!

1. Create the following code in a txt file on your local folder.

US        Melissa Ryan         123 Maple Street    Mill Valley    CA 90952
US        Robert Ryan           8 Oak Avenue        Old Town       PA 95819
ITEMS,ITEM872-AA|Lawnmower|1|148.95|Confirm this is electric,ITEM926-AA|Baby Monitor|1|39.98|Confirm this is electric

2.  In Microsoft Visual Studio 2005, open the Solution Explorer.

3.  To add the new flat file schema, right-click the project, and select Add. Click New Item.

4.  In the Add New Item window, do the following:

    • In the Categories section, select Schema Files.
    • In the Templates section, select Flat File Schema Wizard
    • In the Name field enter PurchaseOrder.xsd for the new schema and click Add.

5.  When the BizTalk Flat File Schema Wizard opens, the Introduction Page appears. To skip this screen when running the wizard in the future, select the Do not show this introduction page again box. Click Next to continue.

                                                BizTalk Server 2006 Flat File Schema Wizard

6.  On the Flat File Schema Information screen, select your instance and enter the following information. When you are done, click Next to continue.

  • Instance file: Click the Browse button to locate the flat file from which the schema will be generated. Browse to the folder contains the text file you prepare in the Prerequisites section of Walkthrough: Creating a Flat File Schema From a Document Instance.
  • Record Name: Type PO as the root name of the schema.
  • Target Namespace: Type http://FlatFileSchemaProject.PurchaseOrder for target namespace of the flat file schema.
  • Code Page: Select UTF-8 (65001) from the drop down list.
  • Count Positions in bytes: Check this box, if you wish to count the positional data fields by bytes. Be default, the positional data fields are counted by characters. In this sample, leave the Count Position in Bytes option unchecked.

                                             Schema Document

Note: Here, we can select either part of the schema or entire schema depending on our requirement. To select entire schema, press Ctrl+A and click next.

7. As each line of the purchase order ends with a carriage return line feed (CRLF), select By delimiter symbol and then click Next on Select Record Format screen.

                                            Delimiter Document       

9.   Check Record has a tag identifier box and type PO in Tag. In a multiple records file, PO will be used to identify each individual record. Click Next to continue.

10. Now we need to identify the elements of the Purchase Order.

  • The wizard has identified 4 elements in the PO record. We need to define the element type, data type and data for each field.
  • In the first row, select and type the Element Name as Date.
  • Select Field Element as the Element Type.
  • Select Date from the Data Type drop down list.
  • In the second row, rename the Field 2 to Customers and select Repeating Record type from the Element Type drop down list.
  • In the third row; select Ignore from Element Type drop down list.
  • In the fourth row; rename Child4 to Items and select Record from Element Type drop down.
  • click Next and now you can see the schema as below:

                                PO Schema

  • Now, we need to define the attributes for Customer record. Select Customers and click Next. 
  • The customer record is highlighted in the Select Document Data screen. Click Next.
  • In the Select Record Format screen, choose the option By Relative Positions.
  • In the Positional Record screen, using left mouse, mark the beginning of each record as shown below:

                                                Customers Record Positions

  • Click Next to name each child element as below:


Element Name

customer_Child2 fullName
customer_Child3 street
customer_Child4 city
customer_Child5 state
customer_Child6 postalcode

To be continued…






  1. Where is the continued part of this?

  2. Where is the continued part of this?

  3. Hi

    I need to debatch a flat file and process it one by one and batch them again before outputting it.

    I need to minimize custom code so if ther is any way by using disassembler or assembler pipeline

    Any Help is appreciated

  4. Hi,

    I too have a similar scenario and would like to see the continutaion of the above documentation…


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: