[Fields]

 

Top  Previous  Next

 

The rest of the .IML file is used to describe the user fields.  Every field in the .LUS file must be listed here.  In addition, if less than 40 user fields are used in the .LUS, you must create an entry for each field up to 40.  Just use the field number instead of the name.

The first entry should be as follows (including the quotes):

Count="40"

After this entry, each of the following base field entries must exist:

CaseId=

Street1=

Street2=

Block1=

Block2=

Mile1=

Mile2=

Date=

Time=

Distance=

ULong=

UWord=

 

This list should be followed by each of the fields in the "fields" section of the .LUS file, followed by the numbers needed to reach 40.

 

For example:

COUNTY=

DIRFROMINT=

MOVEMENT1=

MOVEMENT2=

DIRECTION1=

DIRECTION2=

DIRECTION3=

INJURIES=

FATALITIES=

LIGHTING=

TYPEOFCOLL=

DAMAGESEV=

TYPEVEHICLE1=

TYPEVEHICLE2=

ROADCONDITION=

ROADSURFTYPE=

ROADCONTOUR=

TRAFCONTROL=

WEATHER=

HUMANFACT1=

HUMANFACT2=

PEDACT1=

PEDACT2=

HEAD1=

HEAD2=

VEH1DUI=

VEH2DUI=

28=

29=

30=

31=

32=

33=

34=

35=

36=

37=

38=

39=

40=

 

For each of the keywords listed in the fields section, there must be a corresponding expression which describes where to get that field's data.  The following functions are provided to assist in that task:

 

@FixField( StartPosition, CharCount )

 

Use this function to import data from a standard single line - fixed field file.  StartPosition is the character position of the desired field.  CharCount is the field width.

 

@DelField( FieldNumber [,StartPosition=1 [,CharCount=255]])

 

Use this function to import data from a standard single line - comma delimited file.  If the entire field is desired, you can leave out the StartPosition and CharCount values.

 

@mlDelField( RecType,Instance, FieldNumber [,StartPosition=1[,CharCount=255]])

 

Use this function to import data from a multi-line delimited field data file.  RecType should be number (1-10) which refers to the record type specified in the header.  If there are more than records of this type, Instance can be used to select the specific instance.

 

For example, if each vehicle is in its own record, of the same type, sort the fields and use instance to select the vehicle number.  If there is only once instance of each record type, this value will always be 1.

 

FieldNumber, StartPosition and CharCount values are used in the same manner as in the @DelField function above.

 

@mlFixField( RecType, Instance, StartPosition ,CharCount )

 

Use this function to import data from a multi-line fixed field data file.  RecType should be number (1-10) which refers to the record type specified in the header.  If there are more than records of this type, Instance can be used to select the specific instance.

 

For example, if each vehicle is in its own record, of the same type, sort the fields and use instance to select the vehicle number.  If there is only once instance of each record type, this value will always be 1.

 

StartPosition and CharCount values are used in the same manner as in the @FixField function above.

 

@Field( RecType, Instance, Field , StartPos , CharCount )

 

This function is a catch all for any other record types.  Using it, you can select single-line, multi-line, fixed or delimited field records.  While it can be a lifesaver if no functions exist which fit your situation, it is rarely used because the other functions can usually do the job.  The parameters are the same as for the other functions.

 

In addition to these functions, many of the filter functions can be used to further manipulate the data.

 

Mathematical operators can be used to combine fields.  For example: @DelField( 1, 1, 2 )  + "-" + @DelField( 3 ) could be used to get the first two characters of the first field and add a dash and the entire contents of field 3.  This is a common solution when a database uses case id numbers which repeat each year.  We generally add the year portion of the date field to the specified case id field.  (i.e.: 96-12211 )