%dw 2.0
output application/flatfile schemaPath="src/main/resources/test-data/QBReqRsp.esl", structureIdent="QBResponse"
---
payload
Flat File Format
MIME type: application/flatfile
ID: flatfile
The Flat File format supports multiple types of fixed width records within a single message. The schema structure allows you to define how different record types are distinguished, and how the records are logically grouped.
Flat File in DataWeave supports files of up to 15 MB, and the memory requirement is roughly 40 to 1. For example, a 1-MB file requires up to 40 MB of memory to process, so it’s important to consider this memory requirement in conjunction with your TPS needs for large flat files. This is not an exact figure; the value might vary according to the complexity of the mapping instructions. |
Example: Specify a Flat File Schema
This example shows a DataWeave script that outputs data in the Flat File format.
Notice that it uses the schemaPath
and structureIndent
writer properties.
Configuration Properties
DataWeave supports the following configuration properties for this format.
Reader Properties
This format accepts properties that provide instructions for reading input data.
Parameter | Type | Default | Description |
---|---|---|---|
|
|
|
When the schema contains elements of type Binary or Packed, the Valid values are |
|
|
|
Produces an error when set to Valid values are |
|
|
|
Fill character used to represent missing values. To activate a non-default setting, set the
Valid values are |
|
|
|
Fills the entire group when the DEPENDING ON subject is not present. Valid values are |
|
|
|
Specifies the expected type of separation between lines or records:
Note that schemas with type Valid values are |
|
|
|
Allow parsing behavior to keep missing string value fields with a default value in the output map Valid values are |
|
|
|
Path to the schema definition. Specifies the location in your local disk of the schema file that parses your input. |
|
|
|
Segment identifier in the schema for fixed-width or COBOL copybook schemas. Required when parsing a single segment or record definition if the schema includes multiple segment definitions. |
|
|
|
Structure identifier in the schema for flat file schemas. Required when parsing a structure definition if the schema includes multiple structure definitions. |
|
|
|
If set to Valid values are |
|
|
|
For COBOL copybook, truncates DEPENDING ON values to the length used. Valid values are |
|
|
|
By default, the flat file reader and writer use spaces for missing characters and ignore the setting of the Valid values are |
|
|
|
For COBOL copybook, uses the 'strict' ASCII form of sign encoding for zoned decimal values. Valid values are |
Writer Properties
This format accepts properties that provide instructions for writing output data.
Parameter | Type | Default | Description |
---|---|---|---|
|
|
|
Size of the buffer writer, in bytes. The value must be greater than |
|
|
|
Generates the output as a data stream when set to Valid values are |
|
|
|
The encoding to use for the output, such as UTF-8. |
|
|
|
Produces an error when set to Valid values are |
|
|
|
If set to Valid values are |
|
|
|
Fill character used to represent missing values. To activate a non-default setting, set the
Valid values are |
|
|
|
Fills the entire group when the DEPENDING ON subject is not present. Valid values are |
|
|
|
Line break for a record separator. DataWeave uses this property as a separator only when there are multiple records. Values translate directly to character codes, and Valid values are |
|
|
|
Path to the schema definition. Specifies the location in your local disk of the schema file that parses your input. |
|
|
|
Segment identifier in the schema for fixed-width or COBOL copybook schemas. Required when parsing a single segment or record definition if the schema includes multiple segment definitions. |
|
|
|
Structure identifier in the schema for flat file schemas. Required when parsing a structure definition if the schema includes multiple structure definitions. |
|
|
|
Trim values that are longer than the width of a field. Valid values are |
|
|
|
For COBOL copybook, truncates DEPENDING ON values to the length used. Valid values are |
|
|
|
By default, the flat file reader and writer use spaces for missing characters and ignore the setting of the Valid values are |
|
|
|
For COBOL copybook, uses the 'strict' ASCII form of sign encoding for zoned decimal values. Valid values are |