SQL/MX 3.2.1 Management Manual (H06.26+, J06.15+)
Data to Input
The input file, COINPUT_FX, contains records like this:
00000000001,"Test String 3456","111-222-3333","444-555-6666"
00000000002,"ibm ","408-111-2222","408-222-3333"
00000000003,"apple ","408-222-1111","408-333-2222"
00000000004,"tandem ","408-285-5000","408-285-2227"
00000000005,"diyatech ","510-111-2222","510-222-3333"
Format File Describing the Data
Create a format file, FORMFILE2, which consists of [DATE FORMAT], [COLUMN FORMAT], and
[FIXED WIDTH FORMAT] sections:
[DATE FORMAT]
DateOrder=MDY
DateDelimiter=/
TimeDelimiter=:
FourDigitYear=Y
DecimalSymbol=.
[COLUMN FORMAT]
col=id,N
col=company,N
col=phone,N
col=fax,N
[FIXED WIDTH FORMAT]
col=id,1,11
col=company,14,16
col=phone,33,12
col=fax,48,12
RecordLength=61
NOTE: All commas and double-quote characters in the input file are ignored because they are
not covered by any of the col= entries in the [FIXED WIDTH FORMAT] section of the format file.
In this example, the RecordLength value of 61 includes one newline character at the end of each
input record.
import Load Command
This import command imports data into the target table COMPANY from the fixed width input
file COINPUT_FX using the format file FORMFILE2:
import cat.sch.company -i COINPUT_FX -u FORMFILE2 -w FIXED
Example 3: Importing Data From a Fixed Width File Not Separated by Double-Quote Characters
This example is of an import from a fixed width file with data that is not separated by double-quote
characters. It shows the structure of the table to be loaded, the data to be loaded (the input data
file), the format file describing the data, and the import command used to load it.
Table Structure
This statement creates the target table, TABLE_2:
CREATE TABLE table_2
(COL1 CHAR(5)
);
Data to Input
The input file, COINPUT_FX2, contains records like this:
0123456789012345
ABCDEFGHIJKLMNPQ
0123456789012345
Using import to Load SQL/MX Tables 203










