x cd /pub/data/pl942010/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, March 2011, -- */ title "Job to Invoke doset Macro for Sets in pl942010, creating pl942010.datasets"; libname pl942010 '/pub/data/pl942010'; %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=pl942010,debug=1); %macro doit(state,stab); *----------------------------------------------------------------------; %doset(mode=,libname=pl942010, memname=&stab.sums, geouniv=&statenm, units=%str(2010 tract, BG, block, VTD, etc), Years=2010, CreatePgm=cnvt_many_states, Keywords=2010 census pl94 redistricting, Description=%nrbquote(Basic pop counts, by race and hispanic with over-18 detail. Lots of geographic summary lvels. First sub-state numbers released based on 2010 decennial census.), keyvars=SumLev county placefp cousubfp cbsa metrodiv, keyfmats=SumLev county &stab.place &stab.mcd cbsa metrodiv, keyquals=%str(| | state county ), DataSource=%str(U.S. Bureau of the Census), SortedBy=Ngeo_id, UsageNotes=%nrbquote(), SubType=sums, SetGroup=, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/pl942010/Readme.html), debug=1); %doset(mode=,libname=pl942010, memname=&stab.detail, geouniv=&statenm, units=%str(table cell), Years=2010, CreatePgm=cnvt_many_states, Keywords=2010 census pl94 redistricting detail, Description=%nrbquote(We generated one obs for each non-zero cell of the summary tables giving ua one obs per geo, race, hispanic and over18), keyvars=race_id hispanic voteage, keyfmats= | | |, sortprio=9, DataSource=%str(U.S. Bureau of the Census), SortedBy=Ngeo_id, UsageNotes=%nrbquote(), SubType=detail, SetGroup=, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/pl942010/Readme.html), debug=1); %mend doit; /* ========================begin comment==================================== options mprint; %***dostates(01 04 05 06 08 09 10 15 16 17 18 19 20 22 24 28 29 31 32 34 37 38 39 40 41 42 46 48 49 50 51 53 55 56,names=1); ==========================end comment====================================== */ *---Do entries for the us and us..._trends datasets---; %doset(mode=,libname=pl942010, memname=_template_us, geouniv=%str(U.S., incl P.R.), Years=2010, CreatePgm=pl94_usdatasets, Keywords=2010 census pl94 national, Description=%nrbquote(Created by concatenating the specified geographic summary levels from all of the XXsums datasets to create this nationwide dataset), keyvars=SumLev State, keyfmats= sumlev state, sortprio=1, DataSource=%str(U.S. Bureau of the Census), SortedBy=state, SubType=sums, SetGroup=us, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/pl942010/Readme.html), debug=0); %doset(libname=pl942010,template=_template_us, memname=usstates, usageNotes=Data for all the states and Puerto Rico, units=state); %doset(libname=pl942010,template=_template_us, memname=uscounties, usageNotes=%str(Includes county equivalents such as parishes in LA and independent cities in several states), units=county); %doset(libname=pl942010,template=_template_us, memname=usplaces, units=%str(place place/county), sortedby=state placefp, keyvars=SumLev State lsadc county, keyfmats= sumlev state lsadc county, UsageNotes=%nrbquote(), debug=0); %doset(libname=pl942010,template=_template_us, memname=usplaces10k, description=%str(Summaries for 3,907 complete places with minimum 10,000 population in the entire U.S.), units=%str(place (10k pop min)), sortedby=state placefp, keyvars=SumLev State lsadc, keyfmats= sumlev state lsadc, UsageNotes=%nrbquote(), debug=0); %doset(libname=pl942010,template=_template_us, memname=usplaces160, description=%str(Summaries for all 29,415 complete places, regardless of size, in the U.S.), units=place, sortedby=state placefp, keyvars=SumLev State lsadc, keyfmats= sumlev state lsadc, UsageNotes=%nrbquote(), debug=0); %doset(libname=pl942010,template=_template_us, memname=uscousubs, sortedby=state county cousubfp, UsageNotes=%nrbquote(), units=%str(county subdivisions), keyvars=state county lsadc, keyfmats=state county lsadc, debug=0); %doset(libname=pl942010,template=_template_us, memname=netowns, sortprio=5, description=%str(This is just a subset of the uscousubs dataset for the six states making up New England), sortedby=state county cousubfp, UsageNotes=%nrbquote(), units=towns, keyvars=state county lsadc, keyfmats=state county lsadc, debug=0); %doset(libname=pl942010,template=_template_us, memname=uscbsas, description=%str(Aggregated Core Based Statistical Area summaries for entire U.S.), sortedby=cbsa state, UsageNotes=%nrbquote(), units=%str(CBSA, complete and within-state), keyvars=sumlev cbsa state cbsatype, keyfmats=sumlev cbsa state |, debug=0); %doset(libname=pl942010,template=_template_us, memname=usregdiv, description=%str(Aggregated data to summarize the nation and its regions and census divisions), sortedby=sumlev, UsageNotes=%nrbquote(), units=%str(United States, Census Regions, Divisions), keyvars=sumlev, keyfmats=sumlev, debug=0); %doset(mode=,libname=pl942010, memname=_template_ustrends, geouniv=%str(U.S., incl P.R.), Years=2000 2010, CreatePgm=pl94_ustrend_datasets, Keywords=2010 census pl94 national 2000 trends, keyvars=SumLev State, keyfmats= sumlev state, sortprio=2, DataSource=%str(U.S. Bureau of the Census), SortedBy=state, SubType=trends, SetGroup=us, VarSet=, URLMeta=, debug=0); %doset(libname=pl942010,template=_template_ustrends, memname=uscbsa_trends, description=%str(Aggregated Core Based Statistical Area summaries with 2000-SF1 trend data for entire U.S.), sortedby=cbsa state, UsageNotes=%nrbquote(), units=%str(CBSA, complete and within-state), keyvars=sumlev cbsa state cbsatype, keyfmats=sumlev cbsa state |, debug=0); %doset(libname=pl942010,template=_template_ustrends, memname=uscnty_trends, memlabel=%str(County level trends for the entire U.S. incl P.R.), keyvars=sumlev state county cbsa, keyfmats=sumlev state county cbsa, usageNotes=%str( ), units=county); proc sort data=pl942010.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 pl942010.datasets (Sorted by SortPrio)'; run ; proc datasets library=pl942010 nolist; modify datasets; index delete dataset memname; index create dataset=(libname memname) / unique; index create memname; quit; options NOmprint msglevel=i; %gendshtm(libname=pl942010,debug=1,runprocc=0);