
Next: Create the MCD-group Units
Up: A Formal Checklist
Previous: Prepare the state directory
This step consists of transferring this project's three constituent data
files, PL94-171 precinct-level electoral data and STF3a from their original sources (CD-ROMS,
tape archives, etc.) onto the project server's hard disk, converting
them to the project format (SAS), and preparing them to be worked upon.
All files for each state are copied into the state directory.
While loading and converting these three datasets may be
performed in any order, keep in mind that the STF3a datasets in
particular take up a large amount of disk space (100-150 MB) and their
loading may need to be coordinated with the demands of other tasks and
users.
- PL94-171
- Copy the PL94-171 file into the state directory. The
original PL94-171 file will have a filename such as PL9417xx,
where xx is the two-digit state abbreviation code.
There is only
a single file for each state. The original format is
.dbf; codebooks are standard for all states.
- Use DBMSCopy to convert the PL94-171 file from its native
.dbf format to SAS format. (DBMSCopy is a commercial
software program.)
- Move the original PL94-171 files into a single .zip
archive with the name pl94xx.zip.
What should be left over:
- PL9417OK.sd2.
- SAS file containing all PL94-171 data.
- PL94OK.zip.
- zip archive of original PL94-171 files.
- precinct-level electoral data
Because the precinct-level electoral data dataset is split according to year, it comes in
several files. Each file must be dealt with separately (but
equally!).
- Copy the precinct-level electoral data files into the state directory. These files
use the following naming convention:
xxyymp20.dbf
where
xx is the two-digit state abbreviation, and
yy is the year.
- Convert the copied files from their original .dbf into
SAS format (.sd2 or .ssd) using DBMSCopy.
- Delete the original xxyyMP20.dbf and related original
dbase files to conserve disk space.
What should be left over:
- ok84MP20.sd2.
- SAS file containing precinct-level electoral data data for
1984. Other years will be identical in format. Note that the
extensions may actually be .ssd depending on the versions
of SAS and DBMSCopy used.
- ok86MP20.sd2.
-
- ok88MP20.sd2.
-
- ok88MP20.sd2.
-
- STF3a
The STF3a files are split into 35 files in their original form from
the Census Bureau. They are located on CD-ROM, and come in
.dbf format. Since they are so large, our basic strategy is
to load them all onto the server, convert them to SAS format, delete
the .dbf originals, merge them to produce a single file
based only on MCDs, and then delete the 35 SAS-converted originals.
- Copy the files onto the server from the CD-ROMs. [Note: There
is an MS-DOS batch file for this purpose named stfcp-xx.bat
which you should copy into the state directory, rename it
replacing xx with the state abbreviation, and edit the file
to get the state codes right.] These 35 files be named
STF00xx.dbf through STF34xx.dbf.
Put these files into a subdirectory of the state directory called
stf3a. All of the STF3a steps below assume that this data
is in the stf3a subdirectory.
- Translate the 35 files into SAS format using DBMSCopy.
[Note: There is an MS-DOS batch file for this purpose named
stfcv-xx.bat. Copy it into the state directory and rename
and edit it just as you did with stfcp-xx.bat. Executing
this program will invoke DBMSCopy and convert the .dbf
files into .ssd files.]
- Merge the STF3a files into a single, MCD-level file. The
template for doing this is a SAS program named
stfmg-xx.sas. Copy it, rename it, and edit it as
appropriate before submitting it in SAS. Processing this file in
SAS will produce a dataset named stfMCDxx.sd2,
which will combine data from the 35 input files--a total of over
3,000 variables--at the MCD level.
- Move the original 35 .dbf and .ssd files to
conserve disk space. There is a standard MS-DOS batch file to do
this called stfcl-xx.bat.
What should be left over:
- stfMCDok.sd2.
- The SAS dataset
containing census data from STF3a at the MCD level.
- stfmg-ok.sas.
- The SAS program file modified from
the stfmg-xx.sas template, adapted for Oklahoma. Merges
the 35 separate files to create an MCD-level STF3a dataset.
- stfcl-ok.bat.
- The MS-DOS batch file modified from
the stfcl-xx.bat template, adapted for Oklahoma. Removes
and zips files that are no longer needed.
- [Optional:]
-
- stfcp-ok.bat.
- The MS-DOS batch file modified from
the stfcp-xx.bat template, adapted for Oklahoma. Copies
original STF3a files from CD-ROM to the working state directory.
- stfcv-ok.bat.
- The MS-DOS batch file modified from
the stfcv-xx.bat template, adapted for Oklahoma. Automates
the conversion of original files to SAS format using DBMSCopy.

Next: Create the MCD-group Units
Up: A Formal Checklist
Previous: Prepare the state directory