Working with Shift-Sensitive Flat Files - Informatica

You can import shift-sensitive flat files in the Flat File Wizard in both fixed-width mode and delimited mode. A shift-sensitive file may contain both multibyte and single-byte characters. A file may or may not contain shift-in and shift-out keys to separate multibyte characters from single-byte characters.

Shift-in and shift-out keys separate multibyte characters so the Flat File Wizard and the Integration Service can read each character correctly. A shift-out key signals the beginning of a sequence of multibyte characters. A shift- in key signals the end of this sequence. If the file source does not contain shift keys, you need to define shift states for each column in the file so the Integration Service can read each character correctly.

Note:Use single-byte and double-byte shift keys.

Importing Flat Files with Shift Keys

Use the Flat File Wizard to import a file source that contains shift keys. You can import both fixed-width and delimited files that contain shift keys. The Flat File Wizard and the Integration Service use the shift keys in the file to determine the shift state of each column
in the source.

The Flat File Wizard and the Integration Service can handle consecutive shift characters.

The following example is a valid row from a shift-sensitive flat file:


The following table describes the notation used in this example:

Importing Flat Files with Shift Keys

The Flat File Wizard displays single-byte shift characters as ‘.’ in the window. Double-byte shift characters display as ‘..’ in the window. Shift-in characters display on a green background. Shift-out characters display on a blue background.

Requirements for Shift-Sensitive Flat Files

The Designer returns an error if you analyze a shift-sensitive flat file that contains shift-in and shift-out characters, but does not meet the following requirements:

  • A shift-out and a shift-in character must enclose all multibyte characters. Single-byte characters do not need to be enclosed with shift characters.
  • The first shift character in a row must be a shift-out character.
  • A file cannot contain nested shift characters. For example, you cannot have the following sequence:
  • -oAA-oAA-iaaa
  • A shift-in character must close a shift-out character in the same row.

The Flat File Wizard disables the fixed-width option if the file has a multibyte character that contains more than two bytes per character. Each row in a file must not exceed 16 KB.

The Flat File Wizard validates up to 500 rows or 256 KB of data, whichever comes first. If the file does not meet the above requirements, the Integration Service writes errors to the session log.

Importing Flat Files without Shift Keys

Use the Flat File Wizard to import a fixed-width file source that does not contain shift keys. However, after you import the source definition, you must define shift states for each column in the file source definition so the Integration Service can read each character correctly.

You can also import shift-sensitive COBOL files that do not contain shift keys. When you do, you must also define the shift states for each column in the COBOL source definition.

Note:When you create a session using a flat file source that contains user-defined shift states, verify that the code page in the Workflow Manager is the same as the code page you chose in the Designer. If you choose a different source code page in the Workflow Manager, the Integration Service does not use the shift keys you defined in the Designer.

To define shift states for fixed-width shift-sensitive files:

  1. In the Designer, import the flat file source or COBOL file.
  2. In the Source Analyzer, double-click the title bar of the file source definition.
  3. In the Flat File Information section of the Table tab, select Fixed Width and click Advanced.
  4. The Edit Flat File Information - Fixed Width Files dialog box appears.
  5. Select User Defined Shift State and click OK.
  6. Click the Columns tab.
  7. The Shift Key column appears.
  8. Choose a shift key for each column.
  9. Choose Shift-In if the column contains single-byte characters. Choose Shift-Out if the column contains multibyte characters.
  10. Click OK.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Informatica Topics