These macros allow one to choose STF1 or STF3 (1990 or 1980 Census) and to name the county and particular tracts of interest. The chosen macro then extracts the data from the RCF-based raw data files, aggregates the tract data (and stores it in a single observation), and saves the state, county, tract and aggregated-tract data into a SAS data set. By default, all variables from the STF1 or STF3 files are saved, but the program also allows the patron to specify a subset of variables.
1990 Census
tractsub90.mactractsub90.sas
1980 Census
tractsub80.mactractsub80.sas
![]()
tractsubYY.mac).
The programs (tractsubYY.sas) use their respective macros As-Is.
Note: When downloading, you should store both the macro and the program
in the same directory where you will be invoking SAS.
![]()
tractsubYY.sas) you will need to
specify only a few choices
(using an editor like emacs or pico):
tractsubYY.sas) looks like:
%let ver=%str(stf1);Your Change: for STF3, you'd change the line to look like:
%let ver=%str(stf3);
tractsubYY.sas)
looks like:
%let county=%str('037');Your Change: For Kern County (CNTY value '029'), the line would look like:
%let county=%str('029');
tractsubYY.sas)
looks like:
%let traclist=%str('2352.02','2364','2377','2407');Your Change: If you preferred to include tracts 2381, 2395, and 2405, you'd change the line to look like:
%let traclist=%str('2381','2395','2405');
![]()
/tmp)
Example: to have everything deposited in your home directory
(~/) the line would look like this:
%let outpath=%str(~/);
- You can exclude or selectively include certain observations
using IF statements as explained in the programs themsevles.
- You can specify a subset of your choice of variables, if you
wish. Examples are given in the programs.
- You can have the program create a SAS data set (in addition to
the SAS Transport File that is created by default) if you wish.
The programs instruct you which lines to 'uncomment' (and how to
'uncomment' them), if you want a SAS data set.
- The programs use PROC PRINT to print out all the data that have
been saved, including the aggregated line. The data for the entire
State will have the usual SUMLEV value of 40
(SUMRYLVL 4 in the 1980 Census),
the data for the County will have its usual SUMLEV value of 50
(SUMRYLVL 11 in the 1980 Census), and each separate Census
Tract will have a SUMLEV value of 80
(SUMRYLVL 14 in the 1980 Census).
The aggregated data will be in a single observation, with the
'assigned' SUMLEV value of 80.9 (SUMRYLVL 14.9 in the
1980 Census).
![]()
tractsubYY.mac) automatically averages these
kinds of variables over the chosen Census Tracts,
so that the value deposited in the Aggregated line (the observation
in the SAS data set with the SUMLEV value of 80.9 for the 1990
Census or a SUMRYLVL value of 14.9 for the 1980) is an average,
not a sum.
Click here
for a detailed explanation and lists of variable names.
Examples:
Variable Purpose Text entered in 80.9 (or 14.9) by macro: --------------------------------------------------------------------- TRACTBNA Tract Number "Custom" ANPSADPI Descriptive Text "Custom Tract Grouping" LONGITUDE Longitude (nothing)
Click here for details.
USCweb | ITS User Services | ITS Help | Statistics Help Documents