Fixed Width Import and Export logic
The key difference between Fixed Width and CSV imports or exports is the definition file.
Definition file
A definition file determines the columns to import/export and the indices of the position of the columns in the data file. You must create a definition file for every type of Fixed Width Import or Export you perform.
The format of the definition file is as follows:
- Each line must be composed of at least three tokens, delimited by
comma, in this format:
field_name, start_col_index, end_col_index, optional_description
where:
- field_name
- The first token must be the field name in the WBINT_IMPORT or the WBINT_EXPORT table from A to CZ (ensure that the field names correspond to the field columns that you import or export, as specified in the field specification reference of the individual interface chapters).
- start_col_index
- The second token determines the starting index of the column.
- end_col_index
- The third token determines the ending index of the column.
- optional_description
- The last token is optional and is typically used for user descriptions. This token is not used by the processor.
- Any line that starts with the keyword TRAILER is ignored by the
processor; these lines are normally comments in the fixed width file.
Here is an excerpt of a sample definition file:
TRAILER ########################################################### TRAILER This is the definition file for Fixed Width Employee Import TRAILER ########################################################### A,1,10,OVR_START_DATE B,11,20,OVR_END_DATE C,21,37,EMP_NAME D,38,77,EMP_LASTNAME E,78,117,EMP_FIRSTNAME F,118,122,EMP_DAY_START_TIME G,123,162,SHFTPAT_NAME
Example import conversion
A line from a fixed width file, which is used by the definition file:
10/03/2003 2083 SKINNER
Resolves to:
Field | Value |
---|---|
A | 10/03/2003 |
B | null |
C | 2083 |
D | SKINNER |