Table of Contents

Search

  1. Preface
  2. Workflow Manager
  3. Workflows and Worklets
  4. Sessions
  5. Session Configuration Object
  6. Tasks
  7. Sources
  8. Targets
  9. Connection Objects
  10. Validation
  11. Scheduling and Running Workflows
  12. Sending Email
  13. Workflow Monitor
  14. Workflow Monitor Details
  15. Session and Workflow Logs
  16. Session Properties Reference
  17. Workflow Properties Reference

Writing to Fixed-Width Files with Flat File Target Definitions

Writing to Fixed-Width Files with Flat File Target Definitions

When you want to output to a fixed-width flat file based on a flat file target definition, you must configure precision and field width for the target field to accommodate the total length of the target field. If the data for a target field is too long for the total length of the field, the Integration Service performs one of the following actions:
  • Truncates the row for string columns
  • Writes the row to the reject file for numeric and datetime columns
When the Integration Service writes a row to the reject file, it writes a message in the session log.
When a session writes to a fixed-width flat file based on a fixed-width flat file target definition in the mapping, the Integration Service defines the total length of a field by the precision or field width defined in the target.
Fixed-width files are byte-oriented, which means the total length of a field is measured in bytes.
The following table describes how the Integration Service measures the total field length for fields in a fixed-width flat file target definition:
Datatype
Target Field Property That Determines Total Field Length
Number
Field width
String
Precision
Datetime
Field width
The following table lists the characters you must accommodate when you configure the precision or field width for flat file target definitions to accommodate the total length of the target field:
Datatype
Characters to Accommodate
Number
  • Decimal separator.
  • Thousands separators.
  • Negative sign (-) for the mantissa.
String
  • Multibyte data.
  • Shift-in and shift-out characters.
Datetime
  • Date and time separators, such as slashes (/), dashes (-), and colons (:).
  • For example, the format
    MM/DD/YYYY HH24:MI:SS.US
    has a total length of 26 bytes.
When you edit the flat file target definition in the mapping, define the precision or field width great enough to accommodate both the target data and the characters in the preceding table.
For example, suppose you have a mapping with a fixed-width flat file target definition. The target definition contains a number column with a precision of 10 and a scale of 2. You use a comma as the decimal separator and a period as the thousands separator. You know some rows of data might have a negative value. Based on this information, you know the longest possible number is formatted with the following format:
-NN.NNN.NNN,NN
Open the flat file target definition in the mapping and define the field width for this number column as a minimum of 14 bytes.