Thursday, 20 September 2012

How to Use Flat Files In Informatica

To use flat files in Informatica the first step is to import or create the definition in the repository. Once the flat file definition is created we can use them as source, target or lookup in the mappings.

How to import a flat file
First thing we need to make sure is that the flat file should be local directory of the client machine. Once the file is located we can Import the same using Import file Option in Designer. When we import we need to mention the below prompts:
  • File name and location
  • File code page
  • File type
  • Column names and data types
  • Number of header rows in the file
  • Column size and null characters for fixed-width files
  • Delimiter types, quote character, and escape character for delimited files.
Flat files can be of two types:
Fixed width Flat files: 
The data in such flat files are separated by a fixed width and are byte oriented. Hence when we import using the Designer we need to give column breaks using the Flat File Wizard such that there is no misalignment.
Importing Fixed-Width Flat Files:
  • Import the flat file into source or target using the Import from file option in Designer.
  • Select the file and click OK.
  • Enter the type of file as Fixed Width
  • Now you can use the wizard to give the appropriate column breaks.
  • Finish 

Delimited Flat files:
Delimited files are character oriented and are separated by a character. Each row ends with a new line character.
Importing Delimited Flat files:
  • Import the flat file into source or target using the Import from file option in Designer
  • Select the file and click OK.
  •  Select type of file as Delimited for a delimited file.
  •  Enter the details prompted like the type of delimiter used and escape character and click finish

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...