Contact Free trial Login

Fixed Width Format

MIME Type: application/flatfile

ID: flatfile

Fixed width types are technically considered a type of Flat File format, but when selecting this option, the Transform component offers you settings that are better tailored to the needs of this format.

Fixed width 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 fixed width files. This is not an exact figure; the value might vary according to the complexity of the mapping instructions.

Configuration Properties

DataWeave supports the following configuration properties for this format.

Reader Properties

DataWeave accepts properties that provide instructions for reading input data in this format.

Parameter Type Default Description

enforceRequires

Boolean

false

Error if required value missing. Valid values are true or false.

missingValues

String

nulls for copybook schema, spaces otherwise

Fill character used to represent missing values. To represent missing values in the input data, you can use:

  • none: Treat all data as actual values

  • spaces: Interpret a field consisting of only spaces as a missing value

  • zeroes: Interpret numeric fields consisting of only '0' characters and character fields consisting of only spaces as missing values

  • nulls: Interpret a field consisting only of 0 bytes as a missing value

recordParsing

String

strict

Expected separation between lines/records:

  • strict: line break expected at exact end of each record

  • lenient: line break used but records may be shorter or longer than schema specifies

  • noTerminator: records follow one another with no separation

  • singleRecord: entire input is a single record

Note that schemas with type Binary or Packed don’t allow for line break detection, so setting recordParsing to lenient only allows long records to be handled, not short ones. These schemas also currently only work with certain single-byte character encodings (so not with UTF-8 or any multibyte format).

schemaPath (Required)

String

null

Schema definition. Location in your local disk of the schema file used to parse your input.

segmentIdent

String

null

Segment identifier in the schema for fixed width or copybook schemas (only needed when parsing a single segment/record definition and if the schema includes multiple segment definitions).

structureIdent

String

null

Structure identifier in schema for flatfile schemas (only needed when parsing a structure definition, and if the schema includes multiple structure definitions)

truncateDependingOn

Boolean

false

Truncate COBOL copybook DEPENDING ON values to length used. Valid values are true or false.

zonedDecimalStrict

Boolean

false

Use the strict ASCII form of sign encoding for COBOL copybook zoned decimal values. Valid values are true or false.

Writer Properties

DataWeave accepts properties that provide instructions for writing output data in this format.

Parameter Type Default Description

bufferSize

Number

8192

Size of the buffer writer.

deferred

Boolean

false

Property for deferred output. Valid values are true or false.

encoding

String

null

Encoding to be used by this writer, such as UTF-8.

enforceRequires

Boolean

false

Error if a required value is missing. Valid values are true or false.

missingValues

String

nulls for copybook schema, spaces otherwise

Fill character used to represent missing values:

  • none: Write nothing for missing values

  • spaces: Fill field with spaces

  • zeroes: Fill numeric fields with '0' characters and character fields with space characters

  • nulls: Fill field with 0 bytes

recordTerminator

String

System property line.separator

Record separator line break. Valid values:

  • lf

  • cr

  • crlf

  • none

Note that in Mule versions 4.0.4 and later, this is only used as a separator when there are multiple records. Values translate directly to character codes (none leaves no termination on each record).

schemaPath (Required)

String

null

Schema definition. Path where the schema file to be used is located.

segmentIdent

String

null

Segment identifier in the schema for fixed width or copybook schemas (only needed when writing a single segment/record definition, and if the schema includes multiple segment definitions).

structureIdent

String

null

Structure identifier in schema for flatfile schemas (only needed when writing a structure definition and if the schema includes multiple structure definitions)

trimValues

Boolean

false

Trim string values longer than the field length by truncating trailing characters. Valid values are true or false.

trimValues

Boolean

false

Indicates whether trim values are longer than the field width. Valid Options are true or false.

truncateDependingOn

Boolean

false

Truncate DEPENDING ON COBOL copybook values to length used. Valid values are true or false.

zonedDecimalStrict

Boolean

false

Use the strict ASCII form of sign encoding for COBOL copybook zoned decimal values. Valid values are true or false.

Supported MIME Types (for Fixed Width)

The Fixed Width format supports the following MIME types.

MIME Type

*/flatfile

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub