x cd /pub/data/pums2000/Tools; %let pgm=invoke_dosets; filename pgm "&pgm..sas";
/*--Invoke the %doset macro to create observations in the Datasets dataset for this directory.
J. Blodgett, OSEDA, June, 2003
Mods 8/05 to add usage note pointing to pdf maps of pumas.
-- */
title "Job to Invoke doset Macro for Sets in pums2000, creating pums2000.datasets";
libname pums2000 '/pub/data/pums2000';
/*<=========================Comment out=====================================
proc datasets lib=pums2000 nolist;
modify datasets;
index create dataset=(libname memname) / unique;
quit;
===========================End commented out================================ */
*-----Run this step ONLY ONCE------------------------------------------;
*----If you need to rerun (start over) then delete the datasets dataset first. doset will not
allow initialize mode if the datasets set already exists.---;
%*doset(mode=initialize,
libname=pums2000,debug=1);
*----------------------------------------------------------------------;
/* =======================Begin comment================
%doset(mode=,libname=pums2000,
memname=_template_precs1,
memlabel=%nrstr(Person record data, 1 pct sample for ~stab),
geouniv=~statenm,
units=Persons,
Year=2000,
CreatePgm=cnvtpums1,
Keywords=pums microdata census 2000 persons,
Description=%nrbquote(Each observation on this set represents microdata for a person filling out the Long Form in
the 2000 decennial census. This is the 1 pct sample data for ~statenm.),
keyvars=puma1 ,
keyfmats=| ,
keyquals=,
DataSource=%str(2000 Census - Public Use Microdata Sample files as posted on Bureau web site April, 2003),
SortedBy=state puma1 serialno,
UsageNotes=%nrbquote(
- Data for the household in which this person lives is contained in the companion dataset,
~stab.hrecs1. Or, you access the ~stab.1 view which combines the household data and person data into a single observation.
- Users without access to and expertise in using statistical software will not find these datasets very useful.
- SAS users can borrow from the valfmats.sas
module containing codebook type info in the form of SAS proc format Value statements. Even non-SAS users should be able
to benefit from using this as a quick and dirty codebook file.
- It is possible to have an obs on the hrecs dataset with no corresponding data on the precs dataset since the census
includes data for vacant housing units.
- Remember to always specify the weight variable pweight when creating tables from these data.
- The smallest geographic units that can be identified on these files is the Super PUMA, stored as
variable puma1. The Census Bureau has provided maps of these areas accessible from
http://www.census.gov/geo/www/maps/sup_puma.htm .
- The serialno variable is the common key that allows linking precs and hrecs data.
),
SubType=precs,
SetGroup=~stab,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/pums2000/Techdoc/Ch6_Data_Dictionary_1_percent.pdf),
filters=,
debug=1)
%doset(mode=,libname=pums2000,
memname=_template_hrecs1,
memlabel=%nrstr(Household record data, 1 pct sample for ~stab),
geouniv=~statenm,
units=Housing Unit or Person in Group Quarters,
Year=2000,
CreatePgm=cnvtpums1,
Keywords=pums microdata census 2000 housing units,
Description=%nrbquote(Each observation on this set represents microdata for a housing unit (vacant
or occupied) or for group quarters respondent. Look here for data about the housing unit as whole such as geographic
codes or information about the house or the total household. This is the 1 pct sample data for ~statenm.),
keyvars=puma1 areatyp1 msacmsa1 ,
keyfmats=| | metro,
keyquals=,
DataSource=%str(2000 Census - Public Use Microdata Sample files as posted on Bureau web site April, 2003),
SortedBy=state puma1 serialno,
UsageNotes=%nrbquote(Data for each of the persons associated with the housing unit (if any) are
contained in the companion dataset,
~stab.precs1. The value of the variable persons tells you how many such person records to expect.
- Users without access to and expertise in using statistical software will not find these datasets very useful.
- SAS users can borrow from the valfmats.sas
module containing codebook type info in the form of SAS proc format Value statements. Even non-SAS users should be able
to benefit from using this as a quick and dirty codebook file.
- It is possible to have an obs on this dataset with no corresponding data on the precs dataset since the census
includes data for vacant housing units. The Persons variable tells you how many person records are associated with
each house record.
- Remember to always specify the weight variable hweight when creating tables from these data.
- The smallest geographic units that can be identified on these files is the Super PUMA, stored as
variable puma1. The Census Bureau has provided maps of these areas accessible from
http://www.census.gov/geo/www/maps/sup_puma.htm .
- You can access the ~stab.1 view which combines the household data and person data into a single observation.
),
SubType=hrecs,
SetGroup=~stab,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/pums2000/Techdoc/Ch6_Data_Dictionary_1_percent.pdf),
filters=,
debug=1)
%doset(mode=,libname=pums2000,
memname=_template_v1,
memlabel=%nrstr(Household + Person data, 1 pct sample for ~stab),
geouniv=~statenm,
units=Person within housing unit or Vacant unit or Person in Group Quarters,
Year=2000,
CreatePgm=cnvtpums1,
Keywords=pums microdata census 2000 housing units persons,
Description=%nrbquote(These observations are the result of using a SAS view to combine the variables from the
housing record with that from a person record (if any). This is the 1 pct sample data for ~statenm),
keyvars=puma1 areatyp1 msacmsa1 ,
keyfmats=| | metro,
keyquals=,
DataSource=%str(2000 Census - Public Use Microdata Sample files as posted on Bureau web site April, 2003),
SortedBy=state puma1 serialno,
UsageNotes=%nrbquote(- This dataset is the result of merging the ~stab.precs1 dataset with the ~stab.hrecs1 dataset.
For households with multiple persons the H record items are repeated for each observation on this data file. For an analysis
of household level data, you may be better off accessing the ~stab.hrecs1 dataset.
- Users without access to and expertise in using statistical software will not find these datasets very useful.
- For vacant housing units all variables that come from the precs dataset will be set to missing. You can easily identify
such cases because they have a value of 0 for the variable persons.
- You will always need to specify a weight variable when building tables from this dataset. You can use either the
household weight variable, hweight, or the person weight variable, pweight. Knowing which to use can be tricky - it depends
on the data being tabulated.
- The smallest geographic units that can be identified on these files is the Super PUMA, stored as
variable puma1. The Census Bureau has provided maps of these areas accessible from
http://www.census.gov/geo/www/maps/sup_puma.htm .
- Complete technical documentation for pums 2000 is available at
https://mcdc.missouri.edu/pub/data/pums2000/Techdoc/index.html
),
SubType=v1,
SetGroup=~stab,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/pums2000/Techdoc/Ch6_Data_Dictionary_1_percent.pdf),
filters=,
debug=1)
%doset(mode=,libname=pums2000,
memname=_template_precs5,
memlabel=%nrstr(~statenm Person record data, 5 pct sample),
geouniv=~statenm,
units=Persons,
Year=2000,
CreatePgm=cnvtpums5,
Keywords=pums microdata census 2000 persons,
Description=%nrbquote(Each observation on this set represents microdata for a person filling out the Long Form in
the 2000 decennial census. This is the 5 pct sample data for ~statenm. Does not contain data regarding the complete
household, just individuals.),
keyvars=puma1 puma5,
keyfmats=| | ,
keyquals=,
DataSource=%str(2000 Census - Public Use Microdata Sample files as posted on Bureau web site summer, 2003),
SortedBy=state puma1 puma5 serialno,
UsageNotes=%nrbquote(- Data for the household in which this person lives is contained in the companion dataset,
~stab.hrecs5. Or, you access the ~stab.5 view which combines the household data and person data into a single observation.
- Users without access to and expertise in using statistical software will not find these datasets very useful.
- SAS users can borrow from the valfmats.sas
module containing codebook type info in the form of SAS proc format Value statements. Even non-SAS users should be able
to benefit from using this as a quick and dirty codebook file.
- It is possible to have an obs on the hrecs dataset with no corresponding data on the precs dataset since the census
includes data for vacant housing units.
- Remember to always specify the weight variable pweight when creating tables from these data.
- The smallest geographic units that can be identified on these files is PUMA, stored as
variable puma5. The Census Bureau has provided maps of these areas accessible from
http://www.census.gov/geo/www/maps/puma5pct.htm .
- The serialno variable is the common key that allows linking precs and hrecs data. The data are sorted by state,
puma1, puma5 and serialno.
),
SubType=precs,
SetGroup=~stab,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/pums2000/Techdoc/Ch7_Data_Dictionary_5_percent.pdf),
filters=,
debug=1)
%doset(mode=,libname=pums2000,
memname=_template_hrecs5,
memlabel=%nrstr(~statenm Household record data, 5 pct sample),
geouniv=~statenm,
units=Housing Unit or Person in Group Quarters,
Year=2000,
CreatePgm=cnvtpums5,
Keywords=pums microdata census 2000 housing units group quarters,
Description=%nrbquote(Each observation on this set represents microdata for a housing unit (vacant
or occupied) or for a person residing in group quarters. Look here for data about the housing unit as whole such as geographic
codes or information about the house or the total household. This is the 5 pct sample data for ~statenm.),
keyvars=puma1 puma5 areatyp5 msacmsa5 ,
keyfmats=| | | metro,
keyquals=,
DataSource=%str(2000 Census - Public Use Microdata Sample files as posted on Bureau web site summer, 2003),
SortedBy=state puma1 puma5 serialno,
UsageNotes=%nrbquote(Data for each of the persons associated with the housing unit (if any) are
contained in the companion dataset,
~stab.precs5. The value of the variable Persons (in this dataset) tells you how many such person records to expect.
When persons has a value of 0 you are looking at data for a vacant unit.
- Users without access to and expertise in using statistical software will not find these datasets very useful.
- SAS users can borrow from the valfmats.sas
module containing codebook type info in the form of SAS proc format Value statements. Even non-SAS users should be able
to benefit from using this as a quick and dirty codebook file.
- It is possible to have an obs on this dataset with no corresponding data on the precs dataset since the census
includes data for vacant housing units.
- Remember to always specify the weight variable hweight when creating tables from these data.
- The smallest geographic units that can be identified on these files is PUMA, stored as
variable puma5. The Census Bureau has provided maps of these areas accessible from
http://www.census.gov/geo/www/maps/puma5pct.htm .
- You can access the ~stab.5 view which combines the household data and person data into a single observation.
),
SubType=hrecs,
SetGroup=~stab,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/pums2000/Techdoc/Ch7_Data_Dictionary_5_percent.pdf),
filters=,
debug=1)
%doset(mode=,libname=pums2000,
memname=_template_v5,
memlabel=%nrstr(~statenm Household + Person data, 5 pct sample),
geouniv=~statenm,
units=Person within housing unit in Group Quarters or Vacant unit,
Year=2000,
CreatePgm=cnvtpums5,
Keywords=pums microdata census 2000 housing units persons,
Description=%nrbquote(These observations are the result of using a SAS view to combine (merge) the variables from the
housing record with that from a person record (if any). This is the 5 pct sample data for ~statenm),
keyvars=puma1 puma5 areatyp5 msacmsa5 ,
keyfmats=| | | metro,
keyquals=,
DataSource=%str(2000 Census - Public Use Microdata Sample files as posted on Bureau web site summer, 2003),
SortedBy=state puma1 puma5 serialno,
UsageNotes=%nrbquote(- This dataset is the result of merging the ~stab.precs5 dataset with the ~stab.hrecs5 dataset.
For households with multiple persons the H record items are repeated for each observation on this data file. For an analysis
of just household level data, you may be better off accessing the ~stab.hrecs5 dataset.
- Users without access to and expertise in using statistical software will not find these datasets very useful.
- For vacant housing units all variables that come from the precs dataset will be set to missing. You can easily identify
such cases because they have a value of 0 for the variable Persons.
- You will always need to specify a weight variable when building tables from this dataset. You can use either the
household weight variable, hweight, or the person weight variable, pweight. Knowing which to use can be tricky - it depends
on the data being tabulated.
- The smallest geographic units that can be identified on these files is PUMA, stored as
variable puma5. The Census Bureau has provided maps of these areas accessible from
http://www.census.gov/geo/www/maps/puma5pct.htm .
- Complete technical documentation for pums 2000 is available at
https://mcdc.missouri.edu/pub/data/pums2000/Techdoc/index.html
),
SubType=v5,
SetGroup=~stab,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/pub/data/pums2000/Techdoc/Ch7_Data_Dictionary_5_percent.pdf),
filters=,
debug=1)
;
%macro doit1(state,stab);
*----OK, we have defined the templates, now lets get on with the actual datasets-----------------------*;
%doset(libname=pums2000,
memname=&stab.precs1,template=_template_precs1)
%doset(libname=pums2000,
memname=&stab.hrecs1,template=_template_hrecs1)
%doset(libname=pums2000,
memname=&stab.1,template=_template_v1)
%mend doit1;
%dostates(17 20 29,names=1,msgs=1,mac=doit1)
;
======================End comment================== */
%macro doit5(state,stab);
%doset(libname=pums2000,
memname=&stab.precs5,template=_template_precs5)
%doset(libname=pums2000,
memname=&stab.hrecs5,template=_template_hrecs5)
%doset(libname=pums2000,
memname=&stab.5,template=_template_v5)
%mend doit5;
*---the dostates macro is in /pub/sas/macros/dostates.sas and is used as a "driver" to invoke the doit macro once for
each state indicated by having their fips code appear in positional parm. names=1 causes it to assign a value to
the global variable statenm containing the name of the state. The templates used contain references to the stab
and statenm global variables. ---;
%dostates(n=51,names=1,mac=doit5);
%doset(libname=pums2000,memname=puma5_puma1,
memlabel=%nrstr(For all PUMAs in US shows Superpuma, powpuma5 and migpuma5),
geouniv=UnitedStates,
units=puma5 within state,
Year=2000,
CreatePgm=puma5_topuma1,
Keywords=pums microdata census 2000 superpuma migpuma powpuma correspondence,
Description=%nrbquote(Each observation on this set describes a 5 percent 2000 PUMA code. It reports the
corresponding "SuperPUMA" code as well as the Place of Work PUMA and Migration PUMA codes used on the 5 percent sample
files.),
UsageNotes=%nrbquote(The source for the powpuma5 and migpuma5 codes were the two xls files included as Appendices
N and M in the Technical Documentation. We found two typo errors in the POW puma codes that we corrected (in Minnesota
and Pennsylvania). See csv file where
we did the edits.),
keyvars=state puma1 puma5 ,
keyfmats=state | | ,
keyquals= | state state,
DataSource=%str(2000 Census - Public Use Microdata Sample files as posted on Bureau web site summer, 2003),
SortedBy=state puma5 puma1,
SubType=georef,
SetGroup=,
VarSet=,
URLMeta=,sortprio=4)
*<==================================Need to create entries for variables and varvals metadata sets----------------;
*----Adding entries for the 3 US SAS data step views, 3/2004-----*;
%let stab=us; %let statenm=United States;
%doset(libname=pums2000,
memname=&stab.precs5,template=_template_precs5,
memlabel=%str(Person record data, 5 pct sample - Entire US),
description=%str(Each observation on this set represents microdata for a person filling out the Long Form in
the 2000 decennial census. This is the 5 pct sample data for the entire United States. It does not contain data regarding
the complete household, just individuals.),
universe=UnitedStates,
keyvars=state,
keyfmats=state,
CreatePgm=union_all_states,
UsageNotes=%nrbquote(- This file (dataset) is way too large. To access it you must use filters and
selected variables. Even then, you will probably time out using Dexter to access it because of the time it takes to
access the millions of observations, even if you do not select them all. If you need to access such a national
collection please contact us to request
a custom extract.
- This dataset is just like the precs5 dataset for any state, except this is for the entire country.
- This is a view so you will not get a report indicating the number of rows. But there are 14,081,466
virtual observations here. If it were a "real" dataset instead of a view, it would
be the largest in the archive (though not as large as the us5 dataset, if it were a real dataset, instead of a view).
)
);
%doset(libname=pums2000,
memname=&stab.hrecs5,template=_template_hrecs5,
memlabel=%str(Household record data, 5 pct sample - Entire US),
universe=UnitedStates,
Description=%nrbquote(Each observation on this set represents microdata for a housing unit (vacant
or occupied) or for a person residing in group quarters. Look here for data about the housing unit as whole such as geographic
codes or information about the house or the total household. This is the 5 pct sample data for the entire United States.),
keyvars=state,
keyfmats=state,
CreatePgm=union_all_states,
UsageNotes=%nrbquote(
- This file (dataset) is way too large. To access it you must use filters and
selected variables. Even then, you will probably time out using Dexter to access it because of the time it takes to
access the millioDescription=%nrbquote(Each observation on this set represents microdata for a housing unit (vacant
or occupied) or for a person residing in group quarters. Look here for data about the housing unit as whole such as geographic
codes or information about the house or the total household. This is the 5 pct sample data for ~statenm.),
ns of observations, even if you do not select them all. If you need to access such a national
collection please contact us to request
a custom extract.
- This dataset is just like the hrecs5 dataset for any state, except this is for the entire country.
- This is a view so you will not get a report indicating the number of rows or columns. But there are 6,184,438
virtual observations here and the usual 112 or so variables. If it were a "real" dataset instead of a view, it would
be one of the largest in the archive (though not as large as the us5 and usprecs5 datasets,
if they were real datasets, instead of a views).
)
);
%doset(libname=pums2000,
memname=&stab.5,template=_template_v5,
memlabel=%str(Merged Household and Person record data, 5 pct sample - Entire US),
universe=UnitedStates,
Description=%nrbquote(These observations are the result of using a SAS view to combine (merge) the variables from the
housing record with that from a person record (if any). This is the 5 pct sample data for the entire United States.),
keyvars=state,
keyfmats=state,
CreatePgm=union_all_states,
UsageNotes=%nrbquote(
- This file (dataset) is way too large. To access it you must use filters and
selected variables. Even then, you will probably time out using Dexter to access it because of the time it takes to
access the millions of observations, even if you do not select them all. If you need to access such a national
collection please contact us to request
a custom extract.
- This view is actually the merging of the other two national views, ushrecs5 and usprecs5. The key variables
used in joining observations from these 2 datasets are State, puma1, puma5 and serialno. There are cases where the
ushrecs5 dataset represents a vacant unit and then there is no matching usprecs5 opbservation. In these cases all
the person record variables are set to missing values.
- This is a view so you will not get a report indicating the number of rows or columns. But there are 14,602,690
virtual observations here and the usual 275 or so variables. If it were a "real" dataset instead of a view, it would
be the largest in the archive.). (though not as large as the us5 and usprecs5 datasets,
if they were real datasets, instead of a views. )
);
proc sort data=pums2000.datasets out=bysortprio; by sortprio; run;
proc print data=bysortprio;
by libname notsorted libpath ;
id memname;
var SortPrio SetGroup SubType VarSet URLmeta GeoUniv years ;
title2 'Listing of Selected Fields from pums2000.datasets (Sorted by SortPrio)';
run ;
proc datasets library=pums2000 nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options mprint msglevel=i;
%gendshtm(libname=pums2000,debug=1,runprocc=0);