Sections of the *.DEF File
Use the File>Import form to import data into the system. The definition file describes how to interpret the information contained in the separate data file. The definition and data files can have any filename.
Note: Keep in mind, when you are reviewing a definition file, if a line is preceded by REM, this line is ignored because the system considers it a remark or comment.
If you are using an existing, master definition file as a starting point, copy the file and change the segments to match your Chart of Accounts structure. This will allow you to maintain the original files, that work with the sample data NTO, for future reference. Also note that the master and sample files get replaced with any system upgrade.
Every definition file contains both the Environment and Context sections. The File, Context ID Position, File Type, Transaction Line, and Formatting statements are part of the Environment section, while the Context ID statement makes up the Context section.
Note: This sample *.DEF file contains a predefined error exception file name in the Environment Section - 1: File Statement. For more information about using the predefined error exception file, see Error Exception File.
FILE,{Record Type},{Path and Filename of Data File}, , {Path and Filename of Error Exception File}
2: Context ID Position Statement
CONTEXTIDPOSITION,{Column Position/Field},{Field Length},{Default Value}
FILETYPE,{POSLEN OR CSV}
TRANSACTION_READ,{Method}
DISCARDFIRSTNRECORDS,{# of rows to be ignored}
GEN_CODING
APPLY_OFFSETS
CLEANLINE_READ,{1 Enables}
SUPPRESSWARNINGS
SEGMENTNOTSTRING
USEDISTCODE
UPDATEITEM
UPDATETS
PREVALIDATE
6: Context ID Statement - CSV Formatting or 6: Context ID Statement - Fixed-Width Formatting
CSV:
CONTEXT,{Record Type},{Header or Detail},{Context ID}
{Context Type}_{Field Name},{Field Position in CSV},{Default Value},{Date Mask},{Position in String},{Field Length},{Decimal Places}
ENDCONTEXT
Fixed-Width:
CONTEXT,{Record Type},{Header or Detail},{Context ID}
{Context Type}_{Field Name},{Starting Column},{Field Length},{Default Value},{Decimal Places},{Date Mask}
ENDCONTEXT
Note: The following illustration outlines the statements and sections of a definition file. It is NOT intended to represent an actual definition file. For example, the UPDATEITEM formatting statement nor the UPDATETS formatting statement should not be used with this type of CSV file, but this is the correct placement for either statement. This illustration is combining multiple statements into one example; therefore, its focus is on the placement of the statements, not the data.