Columnar (Fixed-format) ASCII Files

Restriction: This topic applies to Windows environments only.

Use this format to import data from columnar, fixed-format ASCII files. This format is a common means of transferring data from one program to another. Many software applications (including SQLWizard) provide a means of creating and reading ASCII output files. There are two ASCII file formats:

The new XDB Server table definition suggested by SQLWizard when it examines a free-format ASCII file depends on the data found in the file and the parameters you enter on the Import window. You can examine the file by using the Source File command from the View menu. If needed, you can change the suggested table definition in the table display area on the Import window. You must specify the following:

When you use the Browse button to choose a file to import, SQLWizard defaults the file listing to the *.fix extension. The file you are importing can have a different extension.

The following table shows you the fixed-format ASCII format options:

Spaces The Import utility requires that you confirm the number of blank spaces between columns. This is done by providing a number in the Spaces entry field on the Import window.
Heading If the first row of the file you are importing contains field names, click the Heading checkbox to select it. This tells Import to use those names as the column names in the table you are creating. If record data begins in the first row, then uncheck the Heading checkbox to turn off inclusion of a heading row.
Table Definition When importing fixed-format ASCII files in interactive mode, SQLWizard suggests a table definition based on the contents of the data file. You must examine and modify the source file offsets and lengths in the suggested table definition before you import the file. This must be done for all fixed-format ASCII imports, even if you are importing to an existing XDB Server table.
  Offsets Each column of data in a fixed-format ASCII file begins at a fixed point. The Offsets parameter indicates the number of characters from the beginning of the record to the beginning of the column specified. The system examines the row containing the column names (if any) to determine the offset. If the column names appear in the first row and consist of a single word that is left-justified over the column, the system should find the correct offset for you. Otherwise you will have to examine the data to determine the offset, and enter it in the appropriate location in the Offset column of the Table Definition Grid. Use the Source File command from the View menu to display the source file. The ruler at the top of the window corresponds to the offset.

Use the beginning column number as the offset for each column. For example, in the following file, the offset for the E_NO column is 1, the offset for the LNAME column is 11, etc.

  Src Len (Source Length) When importing fixed-format ASCII files, Source Length refers to the width of the column in the source file. This value is used to determine where a column of data ends. Even if the target XDB Server table already exists, you must supply the length of each column in the source file. SQLWizard suggests a length for fields based on the source file structure. You must check and correct the source length for all columns in the Table Definition Grid before attempting to import the table.