×
Menu

Loader Definition File

 
The loader Definition file is a comma separated values file that defines the mapping between a host system data file and the Mars data schema. The high level mappings and input types are described in Appendix A but may be modified to some extent to allow a custom mapping from the host system to Mars.
 
The high level objects that are pre-mapped are:
 
Items (version 1, 2 and 3)
Vendors
Open POs
Comments (Vendor and Item)
Item History
 
The format of each line in the Definition file is as follows:
Name,Table,Field,Start,Length,Decimals,Type
 
Name: Display name of the data field (optional). This field should be short and descriptive and not use any special characters.
 
Table: The name of the table to which the data field belongs. All data fields in a single definition file should have the same table name. Do not include the schema name in the table name. Use ITEMS rather than dbo.ITEMS.
 
Field: The database table column name corresponding to the data field.
 
Start: The starting position in the flat data file (starting with position 1). It is not required that the mappings are in order within the definition file, but it is preferred. The host input file can also be used to map the same host value to multiple Mars values. For example, Venus users have both a Mars unit of measure and a Venus size column in the ITEMS table. Both can be loaded with the same value like this:
 
U of M,ITEMS,unit_meas_im,59,4,0,TEXT
Size,ITEMS,msize_im,59,4,0,TEXT
 
 
Length: The length of the data field (cannot exceed the maximum size of the corresponding database column). The host input file should be padded with blanks or zeros to fill in the full length of the field.
 
Decimals: How many decimal places to apply to a flat numeric field. Text fields should have 0 as the decimal value. Numeric fields are entered without a decimal point. The decimal is implied by the Decimals entry. For example sales history for last month is defined in the Definition file as:
 
History 1,ITEMS,h_im_1,126,14,4,FLOAT
 
If the sales value is 1.0000, the corresponding data value in the input file would be: 00000000010000
If the sales value is 50.5, the corresponding data value in the input file would be: 00000000505000
If the sales value is 4.1234, the corresponding data value in the input file would be: 00000000041234
If the sales value is 1,000,000.5000, the corresponding data value in the input file would be: 00010000005000
It is also acceptable to left pad with blank spaces: [00010000005000] is the same as [   10000005000]
 
Type: Either TEXT or FLOAT (case sensitive) to indicate if the data is text or numeric. All text fields are TEXT and all numeric fields are FLOAT. The field type is determined by its definition in the Mars database schema. For example Item and Vendor IDs are TEXT even if the customer uses 12345 as the ID.