x cd /pub/data/acs2006/Tools; %let pgm=invoke_dosets_basetbls; filename pgm "&pgm..sas";
/*--Invoke the %doset macro to create observations in the Datasets dataset for the acs2006/summary directory.
J. Blodgett, OSEDA, Nov., 2007
Rev. 11/12/2007 11:47:05 AM
Formerly run as invoke_dosets_summary but now being rerun after we moved the summary subdir to basetbls. 10-29-08.
-- */
title "Job to Invoke doset Macro for Sets in acs2006/summary, creating summary.datasets";
libname acs2006 '/pub/data/acs2006';
libname basetbls '/pub/data/acs2006/basetbls';
%let libnameg=basetbls;
%let gyear=2006;
*-----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=basetbls,debug=1);
*----------------------------------------------------------------------;
options mprint;
*--Create the templates for the 4 datasets: 2 decades (20xx and 19xx) and 2 types (orignal and _sumry)---;
%doset(memname=_template_ustabs,
filetype=acs2006,
geouniv=United States,
units=%nrbquote(Nation State County PUMA etc),
Year=&gyear,
CreatePgm=cnvt_summary_files,
keyvars=sumlev geocomp state county cbsa ua placefp metrodiv csa necta,
keyfmats=sumlev geocomp state county cbsa uauc2k fplace metrodiv csa necta,
keyquals= %str( | | | | | | state | | |),
DataSource=%str(U.S. Bureau of the Census),
SortedBy=State LogRecno,
UsageNotes=%nrbquote(
- These are all 1-year estimates based on ACS data collected in ~gyear .
- All ustabsXXXXX datasets have the identical geography but each contains a different set of base tables data.
- Specify a filter of State Equal To 29 to select Missouri summaries only. Change 29 to 06 to select California data, etc.
- Expect missing values due to the Bureau policy not to release tables deemed statistically unreliable.
- For now, we have not included any MOE (Margin of [sampling] Error) data. Let us know if you need it.
- The first 2 digits of the table number are a topic code. This dataset contains tables for the following topics:
),
SubType=,
SetGroup=us,
VarSet=,
URLMeta=%str(https://mcdc.missouri.edu/cgi-bin/browse?/pub/data/acs2006/BasevarLabels.sas@)
);
%doset(libname=basetbls,memname=ustabs00_07,template=_template_ustabs,filetype=acs2006,
Description=%nrbquote(Detailed (aka "base") tables for selected topics from 2006 ACS for geographic areas of 65,000+ for US),
UsageNotes=%nrbquote(+08:Age and Sex / 02:Race / 03: Hispanic Origin / 04: Ancestry / 05: Foreign Born, Citizenship
/ 06: Place of Birth / 07: Residence Last Year, Migration.
),
debug=1) ;
%doset(libname=basetbls,memname=ustabs08,template=_template_ustabs,filetype=acs2006,
Description=%nrbquote(Detailed (aka "base") tables for selected topics from 2006 ACS for geographic areas of 65,000+ for US),
UsageNotes=%nrbquote(+01: Journey to Work, Worker Characteristics.
On many of these tables the geography refers to the place of work rather than the residence. Many geographic areas have no such
data reported so you will see a lot of missing data on this set. ),
debug=0) ;
%doset(libname=basetbls,memname=ustabs09_16,template=_template_ustabs,filetype=acs2006,
Description=%nrbquote(Detailed (aka "base") tables for selected topics from 2006 ACS for geographic areas of 65,000+ for US),
UsageNotes=%nrbquote(+09: Children, Relationship / 10: Grandparents, Age of HH members / 11: Households, Families / 12 Marital Status
/ 13: Fertility / 14: School Enrollment / 15: Educational Attainment / 16: Language Spoken at Home ),
debug=0) ;
%doset(libname=basetbls,memname=ustabs17_20,template=_template_ustabs,filetype=acs2006,
Description=%nrbquote(Detailed (aka "base") tables for selected topics from 2006 ACS for geographic areas of 65,000+ for US),
UsageNotes=%nrbquote(+17: Poverty / 18: Disability / 19: Income (Household, Family) / Earnings ),
debug=0) ;
%doset(libname=basetbls,memname=ustabs21_24,template=_template_ustabs,filetype=acs2006,
Description=%nrbquote(Detailed (aka "base") tables for selected topics from 2006 ACS for geographic areas of 65,000+ for US),
UsageNotes=%nrbquote(+21: Veteran Status / 22: Transfer Programs, Food Stamps / 23: Employment Status / 24: Industry, Occupation,
Class of Worker ),
debug=0) ;
%doset(libname=basetbls,memname=ustabs25_26,template=_template_ustabs,filetype=acs2006,
Description=%nrbquote(Detailed (aka "base") tables for selected topics from 2006 ACS for geographic areas of 65,000+ for US),
UsageNotes=%nrbquote(+25: Housing Characteristics / 26: Group Quarters (just 1 data cell) ),
debug=0) ;
proc sort data=basetbls.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 basetbls.datasets (Sorted by SortPrio)';
run ;
proc datasets library=basetbls nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options mprint msglevel=i;
%gendshtm(libname=basetbls,debug=1,runprocc=1);