Integration Cloud 6.1.0 | Applications | Flat File Applications | Creating a flat file Application from a sample file
 
Creating a flat file Application from a sample file
When you create a flat file Application from a sample file, ensure that the format of the sample file is *.txt.
To create a flat file Application from a sample file
1. From the Integration Cloud navigation bar, click Projects > <Select a Project> > Flat File Applications > Add New Application.
2. Type a name and description of the flat file Application and select the creation mode as Create from a sample file.
3. Click Browse and select the sample file from your computer. The Preview pane displays the sample file.
4. Click Next and in the Record Parser panel, select one of the following to indicate how the data in the sample file is formatted:
Record Parser
Description
Delimiter
Use this parser when each record is separated by a delimiter.
Fixed length
Use a fixed length record parser when each record is of a fixed length (for example, mainframe punch or print records). This parser splits a file into records of the same pre-specified length.
Variable length
This parser expects each record to be preceded by two bytes that indicate the length of the record. Each record may be of different length.
*If you select Delimiter as the parser type, specify the parser properties in the record parser panel. Integration Cloud updates the Preview contents based on your selections. Use the following table to specify the delimiters used in the sample file.
Property
Description
Record
Character that separates records in a flat file document.
Note:
If a new line character (\n) exists at the end of each record and the Record delimiter is not ending with \n, then Integration Cloud cannot render the records properly under the Preview pane.
Field or composite
Character that separates fields in a flat file document.
Subfield
Character that separates subfields in a flat file document.
Quoted release character
Character used to enable a section of text within a field to be represented as its literal value. Any delimiter characters that appear within this section will not be treated as delimiters.
Note:
For example, your field delimiter is (,) and your quoted release character is “. When you want to use (,) within a field as text, you must prefix it with your quoted release character. When using the convertFlatFileToDocument operation to create the strings Doe, John and Doe, Jane, the record would appear as “Doe, John”,“Doe, Jane”. When using the convertDocumentToFlatFile operation to create “Doe, John”,“Doe, Jane”, the value of the record would be Doe, John and Doe, Jane. When using the convertDocumentToFlatFile operation, if you have specified both the Release Character and the Quoted Release Character, the Quoted Release Character will be used.
Release character
Character used to enable a delimiter to be used for its intended, original meaning. The character following the release character will not be treated as a delimiter.
Note:
For example, your field delimiter is + and your release character is \. When using + within a field as text, you must prefix it with your release character. When using the convertFlatFileToDocument operation to create the strings a+b+c and d+e+f, the record would appear as a\+b\+c+d\+e\+f. When using the convertDocumentToFlatFile operation to create a\+b\+c+d\+e\+f, the value of the record would be a+b+c and d+e+f.
*If you select Fixed length as the parser type, specify the parser properties in the record parser panel. Integration Cloud updates the Preview contents based on your selections. Specify the position of each field in Field separators. The Field separators must be comma separated integer values, for example, 5, 10, 15. You can set a value for Record length to adjust the record so that it appears correctly under the Preview pane. Record length supports only positive integer values between one and total number of characters in the file. and cannot be empty.
*If you selected Variable length as the parser type, specify the parser properties in the Record Parser panel. Integration Cloud updates the Preview contents based on your selections. Use the following table to specify the delimiters used in the sample file.
Property
Description
Field
Character that separates fields in a flat file document.
Subfield
Character that separates subfields in a flat file document.
Quoted release character
Character used to enable a section of text within a field to be represented as its literal value. Any delimiter characters that appear within this section will not be treated as delimiters.
For example, your field delimiter is (,) and your quoted release character is “. When you want to use (,) within a field as text, you must prefix it with your quoted release character. When using the convertToValues service to create the strings Doe, John and Doe, Jane, the record would appear as “Doe, John”,“Doe, Jane”. When using the convertToString service to create “Doe, John”,“Doe, Jane”, the value of the record would be Doe, John and Doe, Jane. When using the convertToString service, if you have specified both the Release Character and the Quoted Release Character, the Quoted Release Character will be used.
Release character
Character used to enable a delimiter to be used for its intended, original meaning. The character following the release character will not be treated as a delimiter. For example, your field delimiter is + and your release character is \. When using + within a field as text, you must prefix it with your release character. When using the convertToValues service to create the strings a+b+c and d+e+f, the record would appear as a\+b\+c+d\+e\+f. When using the convertToString service to create a\+b\+c+d\+e\+f, the value of the record would be a+b+c and d+e+f.
5. Specifying a Record Identifier
When parsing a file, Integration Cloud looks at a record and extracts an identifier out of the data and uses that identifier to connect the record definition with a particular record in the flat file. The name of the record definition must match the value obtained by the record identifier.
To set the record identifier for a definition, if the flat file contains a record identifier, select Yes in the Record identifier area, and then set the record identifier to one of the following values.
Record identifier
Value
Description
Start at position
Identifies the character position in the record (counting from zero) where the record identifier is located. Start at position record identifiers compare the value that occurs in the record, at the specified offset, to all the record names defined in the flat file structure. Note that the Start at position identifier cannot distinguish between all types of record names.
Note:
For example, if you name records “Rec1” and “Rec,” some instances of “Rec1” may be identified as “Rec,” because “Rec1” begins with “Rec.”
Nth field
Identifies the field in the record (counting from zero) that contains the identifier. Nth field identifiers use the value of the specified field as the record identifier. These identifiers count from zero (0).
Note:
For example, if 2 is specified, the third field is used as the record identifier.
Select No if the flat file does not contain a record identifier.
6. Click Next to view the Flat File Structure. You can add records to the flat file structure and define the hierarchical relationships between them. The application receiving the flat file uses the structure to read the flat file. This structural information identifies the parent-child relationships between different records in the flat file. By nesting record elements in the flat file structure (adding record elements to a record), you can represent the hierarchical structure of the data in the flat file. To add a record, click the Add new element icon and select Record Definition from the Element type field. Specify a name for the record definition and click Finish.
7. To add a Composite Definition after you have added a record definition, click the Add new element icon and select Composite Definition from the Element type field. Specify a name for the record definition and click Finish.
Extractor type
Description
Nth field-Extractor
Field number in the record that contains the composite you want to extract. This pulls the subfield data from the composite. If you leave this property empty, the composite will not be extracted.
To add a Field Definition after you have added a record definition, click the Add new element icon and select Field Definition in the Element type field.
Extractor Type
Description
Fixed Position
Counting from zero (0), indicates a fixed number of bytes to be extracted from a record.
Extractor
Description
Position
Type the first byte to extract from the record. Type the first byte that is not included in the extraction. If you enter a negative number (for example, –1), the extractor returns all bytes from the byte specified in Start to the last byte in the record or composite.
Nth Field
Counting from zero (0), indicates the field that you want to extract from the record.
Extractor
Type a value to indicate the position of the field that you want to extract from the record. This value cannot be null and must be an integer greater than or equal to zero (0).
Note:
For example, if you type 1, the second field will be extracted.
This option is available only if you specified a field delimiter when configuring the definition and structure of the flat file Application. This extractor returns the field as a key–value pair. The key is the name of the field. The value is the String value of the field.
8. Click Finish to create the flat file Application.
After creating the flat file Application, create an Orchestrated Integration, select the flat file Application created, and invoke the following predefined operations:
* convertFlatFileToDocument - Converts the flat file to a document (inbound)
* convertDocumentToFlatFile - Converts a document to a flat file (outbound)