x cd /pub/data/dpro2010/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, May 2011,
-- */
title "Job to Invoke doset Macro for Sets in dpro2010, creating dpro2010.datasets";
libname dpro2010 '/pub/data/dpro2010';
%let libnameg=dpro2010;
options NOmfile;
filename mprint "/pub/data/dpro2010/Tools/mprint.log";
%***let todo=usplaces usplaces160 usplaces10k; *<=======================NOTE===============================;
*-----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=dpro2010,debug=1);
%macro doit(state,stab);
*----------------------------------------------------------------------;
%doset(mode=,libname=dpro2010,
memname=&stab.pros,
geouniv=&statenm,
units=%str(county place mcd slds etc),
Years=2010,
CreatePgm=cnvt_dpro_files,
Keywords=2010 census demographic profiles,
Description=%nrbquote(Demographic profiles data for &statenm),
keyvars=SumLev geocomp county placefp cousubfp cbsa metrodiv,
keyfmats=SumLev geocomp county &stab.place &stab.mcd cbsa metrodiv,
keyquals=%str(| | | state county ),
DataSource=%str(U.S. Bureau of the Census),
SortedBy=,
UsageNotes=%nrbquote(
- See companion &stab.profileplus data set as alternative version.
- Naming convention for table items is the MCDC table-naming standard:
dpsf<t#>i<cell#>,
where t# is the table number and cell# is the cell or item number within the table.
),
SubType=basic,
SetGroup=,
VarSet=,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/dpsf.pdf),
debug=0);
%doset(mode=,libname=dpro2010,
memname=&stab.profileplus,
geouniv=&statenm,
units=%str(county place mcd slds etc),
Years=2010,
CreatePgm=cnvtfile2,
Keywords=2010 census demographic profiles percents,
Description=%nrbquote(This is an enhanced Demographic profiles data for &statenm),
keyvars=SumLev geocomp county placefp cousubfp cbsa metrodiv,
keyfmats=SumLev geocomp county &stab.place &stab.mcd cbsa metrodiv,
keyquals=%str(| | | state county ),
DataSource=%str(U.S. Bureau of the Census),
SortedBy=,
UsageNotes=%nrbquote(- This is an enhanced version of the data contained in &stab.pros data set.
- Variable names are mnemonic. TotPop instead of dpsf1i1.
- Most variables have corresponding derived percentage variables. E.g. Pop0_4 is accompanied by Pct_Pop0_4 .
- Variable names used are consistent with those used on data sets in the sf1prof filetype, which is the 2k census equivalent.
),
SubType=plus,
SetGroup=,
VarSet=,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/dpsf.pdf),
debug=0);
%mend doit;
/* ========================begin comment====================================
%dostates(11 12 21 23 25 26 28 35 38 44 45 47 54,names=1);
%dostates(02 04 06 09 13 16 27 30 33 36 39 72 55,names=1);
%dostates(01 08 10 15 20 29 31 32 37 42 49 53 56,names=1);
%dostates(05 17 18 19 22 24 34 40 41 46 48 50 51 ,names=1);
%***let statenm=%str(United States);
%***doit(00,us);
%**ostates(34,names=1);
%let statenm=United States;
%doset(mode=,libname=dpro2010,
memname=uspros,
geouniv=United States,
units=%str(nation region division state CD CBSA etc),
Years=2010,
CreatePgm=cnvt_dpro_files,
Keywords=2010 census demographic profiles,
Description=%nrbquote(Demographic profiles data for various US geographies. This is the National File as released.),
keyvars=SumLev geocomp,
keyfmats=SumLev geocomp,
DataSource=%str(U.S. Bureau of the Census),
SortedBy=,
UsageNotes=%nrbquote(- See companion &stab.profileplus data set as alternative version.
- Naming convention for table items is the MCDC table-naming standard:
dpsf<t#>i<cell#>,
where t# is the table number and cell# is the cell or item number within the table.
- Limited geography here. We also have us data sets created by concatenating selected geographic levels from all the state data
sets: usstncypros, usplacespros, usmcdcpros, etc.
),
SubType=pros,
SetGroup=,
VarSet=,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/dpsf.pdf),
debug=0);
%doset(mode=,libname=dpro2010,
memname=usprofileplus,
geouniv=United States,
units=%str(nation region division state CD CBSA etc),
Years=2010,
CreatePgm=cnvtfile2,
Keywords=2010 census demographic profiles percents,
Description=%nrbquote(Demographic profiles data for various US geographies. This is the National File as released.),
keyvars=SumLev geocomp county placefp cousubfp cbsa metrodiv,
keyfmats=SumLev geocomp county &stab.place &stab.mcd cbsa metrodiv,
keyquals=%str(| | | state county ),
DataSource=%str(U.S. Bureau of the Census),
SortedBy=,
UsageNotes=%nrbquote(- This is an enhanced version of the data contained in the uspros data set.
- Variable names are mnemonic. TotPop instead of dpsf1i1.
- Most variables have corresponding derived percentage variables. E.g. Pop0_4 is accompanied by Pct_Pop0_4 .
- Variable names used are consistent with those used on data sets in the sf1prof filetype, which is the 2k census equivalent.
- Limited geography here. We also have us data sets created by concatenating selected geographic levels from all the state data
),
SubType=plus,
SetGroup=,
VarSet=,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/dpsf.pdf),
debug=0);
%doset(libname=dpro2010,memname=_template_usgeos,
geouniv=UnitedStates,
units=~unts,
Years=2010,
createpgm=us_datasets,
description=%str(Concatenation of all the ~unts summaries from all the state data sets.),
keyvars=state ~unts,keyfmats=state ~unts,
DataSource=%str(U.S. Bureau of the Census), SortedBy=state,
subtype=~prosplus,
URLMeta=%str(http://www.census.gov/prod/cen2010/doc/dpsf.pdf)
);
==========================end comment====================================== */
options NOmprint;
%*global prosplus;
%*let prosplus=pros;
%macro doussets(prosplus);
%let unts=state county;
%doset(memname=usstcnty&prosplus,template=_template_usgeos, keyvars=county cbsa, keyfmats= county cbsa,
debug=0);
%let unts=place;
%doset(memname=usplaces&prosplus,template=_template_usgeos,keyvars=state placefp,keyfmats=state placefp,keyquals=%str(| state),
UsageNotes=%nrbquote(- Includes all places, including CDPs, of any size.),
debug=0);
%let unts=mcd;
%doset(memname=usmcds&prosplus,template=_template_usgeos,keyvars=state county,keyfmats=state county,
UsageNotes=%nrbquote(
- Only has county subdivsions which are governmental units
),
debug=0);
%let unts=cbsa;
%doset(memname=uscbsas320&prosplus,template=_template_usgeos,keyvars=state cbsa,keyfmats=state cbsa,
UsageNotes=%nrbquote(- These are Summary Level 320 - state/CBSA. 310 level summaries are in the us&prosplus data set.
),
debug=0);
%let unts=slds;
%doset(memname=usslds&prosplus,template=_template_usgeos,keyvars=sumlev state,keyfmats=sumlev state,
UsageNotes=%nrbquote(- These are state legislative districts (both lower and upper chambers) as of 1-1-10.
),
debug=0);
%let unts=metdivcsa;
%doset(memname=usmetdivcsa&prosplus,template=_template_usgeos,keyvars=sumlev state metdiv csa,keyfmats=sumlev state metdiv csa,
UsageNotes=%nrbquote(- These are state portions of metropolitan divisions and Combined Statistical Areas
),
debug=0);
%let unts=;
%doset(memname=usgeocomps&prosplus,template=_template_usgeos,units=state,keyvars=state sumlev geocomp,keyfmats=state sumlev geocomp,
sortprio=7,
UsageNotes=%nrbquote(- These are geographic component summaries from the state datasets.
- There are more geocomp summaries in the us&prosplus data set (the "National File")
),
debug=0);
%mend doussets;
%doussets(pros);
%doussets(plus);
proc sort data=dpro2010.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 dpro2010.datasets (Sorted by SortPrio)';
run ;
proc datasets library=dpro2010 nolist;
modify datasets;
index delete dataset memname;
index create dataset=(libname memname) / unique;
index create memname;
quit;
options NOmprint msglevel=i;
%gendshtm(libname=dpro2010,debug=0,runprocc=0);