Run the zip code interface supplied with Dovetail Agent to load zip code data into table_zipcode.
The interface is located in the zip code directory and consists of two mandatory files:
fc.env - This is a fc.env file for FCFL. Edit it with values to connect to your database.
load_zip.js - This is the interface program. It is a FCFL-based javascript program. It will read the input file and load the zip code records into your database.
Three other files can be created to assist with the interface: the country, state, and time_zone mapping files. See Creating a Mapping File for more information.
To run the interface
Edit the fc.env file with the correct logon parameters.
Copy the zip code data file to the zip code directory.
Rename the file zipcode.in, or edit the interface program and change the name of the input file in the program to match the file you have supplied.
Execute the interface. The command line to execute the interface is:
cscript /nologo load_zip.js <delete_old>
where: <delete_old> is either true or false. If <delete_old> is set to true, all of the records in table_zipcode will be deleted before the new data is loaded. The default value is false.
The program prints out its status as it runs. The interface also generates several output files you can read for more detailed information:
status_zip.log - This file contains the status of the execution with summary statistics on the number of records processed and bypassed and the number of errors and warnings encountered.
error_zip.log - Any significant errors are listed in this file, including the line number of the input line in the data file that caused the error.
warn_zip.log - Any data rows that create warnings are reported in this file, along with the input file line number.
badrec_zip.log - If there are any warnings reported (for example, a data row is missing the required zip code field), the entire data row will be copied into this file. This allows you to go into the bad record file with an editor, edit the rows, and use this file as the input for another run of the interface.