Prizes & Awards
My Profile
Active Members
TodayLast 7 Days
more...
|
New Feature: Community Sites:
Create your own .NET community website and start earning from Google AdSense !
It's Free !
|
Working with Flat-Files
|
What is BizTalk?
BizTalk is the integration system specially invented for Enterprise Application Integration. BizTalk is the Windows Server System. There are certain Pre-requisite that has to be installed in order for BizTalk to get Installed in the System. Here, we are not going to see much about that.This article brings you the information that make you dive deep in to Flat-File Specification.
Introduction BizTalk Server system talks to the heterogeneous System like ERP, CRM, SQL, Web Services and Legacy System, etc. Data coming from these systems may have a different data format. What ever may be the data format at last we are going to process those as XML inside the BizTalk. The messages that talks to the orchestration are XML. Orchestration is the Process of the BizTalk Server system. Each message that resides in the Message Box is picked up the orchestration for the Processing.
In Detail Having seen the little details we now see the detail discussion about the Flat-File Specification in BizTalk.
Let us now consider the records that are coming in file that is to be processed by BizTalk.
Sam, 42, Developer Scott, 45, Program Manager
Above are the two records that contain name, age and designation held by the employee. If it where XML structure is easily explained by the schema. But here we have to create the schema based on the flat-file data format. We have to first define the structure of the Flat-File coming in.
Each field in the flat-file has to be separated with some Delimiters. Delimiters are of two types. Positional Delimiters and Character Delimiter. Even some File combines the positional and Character delimiter and are called as Hybrid-Delimiter.
Positional delimiter
Sam 42 Developer Scott 45 Program Manager
In positional delimiter we follow the defined space limit for every field. If each field didn’t fill up to the defined space they are filled with the Pad Character. We will see similar kinds of properties later.
Above example can also be considered as the Hybrid Delimiter as each record is delimited with the new line.
Types of Flat File Each Flat-File is divided in to 3 main Division. • Flat-File Schema Node • Flat-File Record Node • Flat-File Field Node
Flat-File Schema and Record node give the structure of the document where as the Data go to the Field Node.
Construction of XML from Flat-File
Flat-File Schema Node Before carried away further, we will now define three important Delimiting properties. Delimiting can be before the field it is delimiting, in-between the delimiting fields and at the after the delimiting fields. BizTalk has to be known how the delimiters are positioned. Important thing to note here is that delimiter will not appear after the last field and it will be present even if one field is missing in-between. All these have to be conveyed to the BizTalk. These are conveyed through Infix (in-between), Prefix (before) and Postfix (after).
We will now see some of the commonly used properties of Flat-File schema node.
<Flat-File Schema Node Properties
| Schema Node Property Name | Meaning and Usage | |
|---|
Default Child Delimiter Type | Configures how the default child delimiter for the schema will be specified in the Default Child Delimiter property. Values are Character The delimiter is specified as a character string. Hexadecimal The default delimiter is specified as a hexadecimal value. None Clears the property in the schema document (default property value). |
Default Child Delimiter | Specifies the value of the Default Child Delimiter for the entire schema. This property is not available until the Default Child Delimiter Type property is set. The value of this property may be any string of characters or hexadecimal values, depending on the Child Delimiter Type property. |
Default Child Order | Specifies the default delimiter position used throughout the schema. Permissible values are Prefix, Postfix, and Infix. |
|
| Default Decimal Character Type | Specifies how the Default Decimal Character property is expressed. Values are Character, Hexadecimal, and None. |
| Default Decimal Character | Specifies the decimal character (separating integral and fractional values in a numeric value) used as a default. Values are restricted to any of the predefined characters in the drop-down list (international characters), any single character (or hexadecimal value), or blank to remove this property from the schema. |
| Default Escape Character Type | Configures how the Default Escape Character property is expressed. Permissible values for this property are Character, Hexadecimal, or None to clear this property setting. |
| Default Escape Character | Specifies the default character used to escape reserved characters so that they may be used as literals in a message. This property may be any of the characters in the drop-down list, any single character, or blank to clear the property setting. |
| Default Repeating Delimiter Type | Denotes whether the value of the Default Repeating delimiter property is a character string (Character), hexadecimal value string (Hexadecimal), or None to clear this property. |
| Default Repeating Delimiter | Specifies the character or hexadecimal string used as the default delimiter for repeating fields. Default Wrap Character Type Denotes how the value of the Default Wrap Character property is expressed. Values for this property are Character, Hexadecimal, and None. |
| Default Wrap Character | Specifies, for the entire schema, the default wrap character. This property may take a value from the predefined drop-down list, any single character you provide, or a blank value to clear this property. |
| Count Positions in Bytes | Indicates whether to count positions within fields in a positional message in bytes. Values are Yes (to count by bytes) or No (to count by character). |
| Restricted Characters | This property is a collection of character ranges that may not appear in messages specified by this schema. |
In addition properties mentioned above, following properties are applicable to the records in the Flat – File
Unique Properties of Flat-File Records
| Record Property Name | Meaning and Usage |
| Ignore Record Count | When Yes, this record is ignored when records are accumulated. When No, this record is counted for the total. When left blank, the property is cleared. |
| Preserve Delimiter for Empty Data | Specifies whether delimiters are used when the fields they delimit are empty. By default, BizTalk preserves delimiters for empty fields and suppresses them for empty records. Permissible values are Yes to preserve the delimiter, No to suppress a delimiter, and blank to clear the property. When a record is optional, the delimiter will be suppressed regardless of the value of this property. |
| Suppress Trailing Delimiters | Indicates whether to suppress the delimiter for trailing records (Yes) or retain them (No). No is the default value. |
| Tag Identifier | A character string used to identify a tag for the record. |
| Tag Offset | Specifies the starting position of the record's tag relative to the preceding sibling node or delimiter. This value must be nonzero or blank (default). |
Structure are defined by Schema and record Nodes, now it is the time to look in to the Field Node where actual data is. The properties we are going to see are respective to Positional Message Format.
Flat-File Field Properties
| Field Property Name | Meaning and Usage |
| Custom Date/Time Format | Specifies a character string indicating the format of date/time fields. The drop-down list provides a number of preconfigured formats, but you can specify a custom format string of your own. Allowable separators are dashes, periods, and slashes. Julian dates may not be specified because of their similarity to nondate numeric types. Justification Indicates how data in a positional field is justified when it is shorter than the defined field length. Values are Left and Right. |
| Minimum Length with Pad Character | Controls how the BizTalk serializer will add pad characters to a positional field to achieve the proper overall length for the field. This property may be set only if Pad Character has been configured. |
| Pad Character Type | Denotes how the pad character is expressed. Values are Character, Hexadecimal, and (Default). The latter value clears the property in the schema. |
| Pad Character | Defines a single character that is used by the serializer to pad field values shorter than the space allotted in a positional schema to achieve the proper overall field length. You may select any of the predefined characters in the list box for this property, enter any other single character, or leave the field blank to clear the property in the schema document. |
| Positional Offset | Specifies the start of the field as an integer offset from the previous sibling or delimiter. Any positive integer less than or equal to the value of Positional Length is acceptable. |
| Positional Length | Specifies the length of the field starting from the end of the preceding sibling or delimiter. Any positive integer is accepted. |
Note Positional offset tells the parser when to start treating the characters as real data that is a meaningful part of the current field.
Summary In this we have discussed various issue of Flat file with Delimited option. In the next article I will discuss about the Positional one. Please post the mail if any query arises. Thanks you all for focusing this article.
|
Responses
|
| Author: rajesh kalvakota 15 Aug 2007 | Member Level: Bronze Points : 0 | I am working on xml to flatfile(tab) maps...i need to genereate a number sequence irrevelant of source record name..it means for each and every row in the output file should follow the number sequence. I am suffering with this issue from the past one week..if you need any more detailson this send out an email to rajeshkvn@yahoo.com
|
|