Example—Creating a file format

In this example, you will create a new file format euro_conversion.fileformat to store the definition of a file for future use. While creating a new file format, you will identify the type of the flat file (delimited, fixed-length, or PC/IXF), define the column names, data types, the delimiter characters and so on. You will save the file format inside your data warehousing project and then load the format in the file source operator to import data from the same kind of file.
Procedure

To create the file format:

  1. From the File menu, select New > File Format. The New File window opens.
  2. In the File format name field, type euro_conversion.fileformat and click Finish.
  3. Specify the file format properties as follows:
    1. In the File type list, select Delimited Format.
    2. In the Field delimiter list, select ,.
    3. In the String delimiter list, select ".
    4. In the Date format list, select MM/DD/YYYY.
    5. In the Timestamp format list, leave the default selection as DEFAULT.
    6. Leave the code page and null character properties to the default value.
  4. In the Field list table, click Diagram shows the icon used to add a new column definition. to add a new column definition.
    1. In the Column Name field, type COUNTRY_CODE.
    2. In the Data type list, select INTEGER.
    3. Leave the length and scale fields blank.

    Repeat step 3 to add four more columns in the field list: COUNTRY_CODE, EURO_YEAR, EURO_MONTH, and, EURO_TO_LOCAL, . The field definition should appear as shown in the figure below.

    Diagram shows the definition of the four columns that are added to the field list.
  5. Save the file format. The file format is stored inside the file-formats directory of your data warehousing project.
  6. To use this file format in a file source operator, open the Properties view of the file source operator, click the File Format tab and then click Load from File Format. This approach saves a lot of design time for data flows that import data from the same kind of file.


Feedback | Information roadmap