x cd /pub/data/saipe/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, Nov, 2005 and again, 12/2006 after 2004 data was released and converted. and again, 01/2008 after 2005 data was released and converted. and again, 12/2008 after 2006 and 2007 data were released and converted. and again, 4//2010 after 2008 data were released and converted. and again, 12/2010 after 2009 data were released and converted. and again, 12/2011 after 2010 saipe data were released and converted. 9/2012 after converting sahie 2010 data. 9/2013 after converting sahie 2011 data. 1/2014 after converting the 2012 saipe data. 3/2014 after converting the 2012 saihe data. 12/2014 after converting the 2013 saipe data. 12/2015 after converting the 20132 & 2014 saipe data. 5/2016 after converting 2014 saihe data 12/2016 after converting 2015 saipe data -- */ title "Job to Invoke doset Macro for Sets in saipe, creating saipe.datasets"; %include '/pub/sas/autoexec.sas'; options mprint symbolgen; libname saipe '/pub/data/saipe'; *======Edit parms starting here and including the todo assigment------------------------; %let gyear=2016; *<-----latest income year for which SAIPE estimates are available----; *<----also used for latest sahie estimates, 9/2013--------; %let gyr=%substr(&gyear,3,2); %let gyearm1=%eval(&gyear -1); %*let todo=sahie&gyr sahietotals&gyr mosahie&gyr; %let todo=usstcnty20xx usschldst20xx usstcnty&gyear usschldst&gyear mostcnty&gyear moschldst&gyear; %*let todo=sahie16 mosahie16 sahietotals16; *<---running Aug. 2018 (GPR)--; *-----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=saipe,debug=1); *----------------------------------------------------------------------; %doset(mode=,libname=saipe, memname=usstcnty20xx, memlabel=%nrbquote(US state & county Income & Poverty ests 2000-&gyear), geouniv=UnitedStates, units=US State County, Years=%str(2000-&Gyear), CreatePgm=cnvt_stcnty_20xx, Keywords=Income poverty estimates state county time series post 2000, Description=%nrbquote(Estimates of the number and percent of persons below the poverty level for the total population and selected younger age groups, along with a Median Household Income estimate. These are for income years starting with 2000 and ending with &gyear.), keyvars=SumLev state county Year, keyfmats=SumLev state county, DataSource=%str(U.S. Bureau of the Census: Small Area Income and Poverty Estimates program), SortedBy=Year State county, UsageNotes=%nrbquote(), SubType=stcnty, SetGroup=us, SortPrio=1, VarSet=, URLMeta=%str(http://www.census.gov/did/www/saipe/data/index.html), debug=1); %doset(mode=,libname=saipe, memname=usschldst20xx,memlabel=%nrbquote(US school district Income & Poverty ests 2000-&gyear), geouniv=UnitedStates, units=School District, Years=%str(2000-&Gyear), CreatePgm=cnvt_sd_20xx, Keywords=Income poverty estimates school district time series post 2000, Description=%nrbquote(Estimates of the number and percent of children age 5-17 below poverty. These data are for income years starting with 2000 and ending with &gyear.), keyvars=SumLev state ncescode Year, keyfmats=SumLev state , keyidvars=| | Areaname, DataSource=%str(U.S. Bureau of the Census: Small Area Income and Estimates program), SortedBy=Year State ncescode, UsageNotes=%nrbquote(), SubType=schldst, SetGroup=us, VarSet=, SortPrio=1, URLMeta=%str(http://www.census.gov/did/www/saipe/data/index.html), debug=1); *-------------------Now the new (2008+ vintage) single-year datasetes---------------------------------------------------; %doset(mode=,libname=saipe, memname=usstcnty&gyear, memlabel=%nrbquote(US state & county Income & Poverty ests for &gyear), geouniv=UnitedStates, units=US State County, Years=&Gyear, CreatePgm=cnvt_stcnty_20xx, Keywords=Income poverty estimates state county time series post 2000, Description=%nrbquote(Estimates of the number and percent of persons below the poverty level for the total population and selected younger age groups, along with a Median Household Income estimate. These are for income year &gyear.), keyvars=SumLev state county Year, keyfmats=SumLev state county, DataSource=%str(U.S. Bureau of the Census: Small Area Income and Poverty Estimates program), SortedBy=State county, UsageNotes=%nrbquote(), SubType=stcnty, SetGroup=us, VarSet=, URLMeta=%str(http://www.census.gov/did/www/saipe/data/index.html), debug=1); %doset(mode=,libname=saipe, memname=usschldst&gyear,memlabel=%nrbquote(US school district Income & Poverty ests &gyear), geouniv=UnitedStates, units=School District, Years=&Gyear, CreatePgm=cnvt_sd_20xx, Keywords=Income poverty estimates school district time series post 2000, Description=%nrbquote(Estimates of the number and percent of children age 5-17 below poverty. These data are for income years starting with 2000 and ending with &gyear.), keyvars=SumLev state ncescode Year, keyfmats=SumLev state , keyidvars=| | Areaname, DataSource=%str(U.S. Bureau of the Census: Small Area Income and Estimates program), SortedBy=State ncescode, UsageNotes=%nrbquote(), SubType=schldst, SetGroup=us, VarSet=, URLMeta=%str(http://www.census.gov/did/www/saipe/data/index.html), debug=1); %doset(libname=saipe,memname=mostcnty20xx,template=usstcnty20xx, memlabel=%nrbquote(MO state & county Income & Poverty ests 2000-&gyear), geouniv=Missouri,units=State County,SetGroup=moviews) %doset(libname=saipe,memname=mostcnty&gyear,template=usstcnty20xx, years=&gyear, memlabel=%nrbquote(MO state & county Income & Poverty ests for &gyear), geouniv=Missouri,units=State County,SetGroup=moviews) %doset(libname=saipe,memname=moschldst20xx,template=usschldst20xx, memlabel=%nrbquote(MO school district Income & Poverty ests 2000-&gyear), geouniv=Missouri,SetGroup=moviews) %doset(libname=saipe,memname=moschldst&gyear,template=usschldst20xx, years=&gyear, memlabel=%nrbquote(MO school district Income & Poverty ests for &gyear), geouniv=Missouri,SetGroup=moviews) /* ========================begin comment==================================== %doset(libname=saipe,memname=stateranks&gyear,memlabel=%str(State-level Rankings and trends for &gyearm1.-&gyear), geouniv=UnitedStates, units=State, Years=&gyearm1 &gyear, CreatePgm=rankrepts, Keywords=Income poverty estimates state ranks trends, Description=%nrbquote(Estimates of several key indicators for the 51 states for years &gyearm1 and &gyear.. Includes rank values for each.), keyvars=State Year, keyfmats=state, DataSource=%str(U.S. Bureau of the Census: Small Area Income and Estimates program), SortedBy=State, UsageNotes=%nrbquote(), SubType=stranks, SetGroup=us, VarSet=, URLMeta=%str(http://www.census.gov/did/www/saipe/data/index.html), debug=1); %*----Add entries for the sahie datasets, vintage 2005, as created in 2008---; %doset(libname=saipe, memname=sahie05, geouniv=UnitedStates, units=State County, Year=2005, CreatePgm=cnvt_sahie, Keywords=health insurance coverage, Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage. The estimates provide detail by age, race, gender and income levels for one calendar year.), keyvars=SumLev state county Year agecat racecat sexcat iprcat, keyfmats=SumLev state county | agecat racecat sexcat iprcat, DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program), SortedBy=State county, UsageNotes=%nrbquote(), SubType=sahie, SetGroup=us, VarSet=, URLMeta=%str(http://www.census.gov/hhes/www/sahie/data/2005/index.html), debug=1); %doset(mode=,libname=saipe, memname=mosahie05,template=sahie05,geouniv=Missouri,setgroup=mo) ; %*----Add entries for the sahie datasets, vintage 2006, as created in 2009---; %doset(libname=saipe, memname=sahie07,fixindex=0, geouniv=UnitedStates, units=State County, Year=2007, CreatePgm=cnvt_sahie, Keywords=health insurance coverage, Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage. The estimates provide detail by age, race, gender and income levels for one calendar year.), keyvars=Totflag asri SumLev state county Year agecat racecat sexcat iprcat, keyfmats=| | SumLev state county | agecat racecat sexcat iprcat, DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program), SortedBy=State county, UsageNotes=%nrbquote(), SubType=sahie, SetGroup=us, VarSet=, URLMeta=%str(http://www.census.gov/did/www/sahie/index.html), debug=1); %doset(mode=,libname=saipe, memname=mosahie07,template=sahie07,geouniv=Missouri,setgroup=mo) ; %doset(libname=saipe, memname=sahietotals07, geouniv=UnitedStates, units=State County, Year=2007, CreatePgm=cnvt_sahie, Keywords=health insurance coverage, Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage. This is a subset of the more detailed estimates in sahie07. This set has data only for the total population under age 65.), keyvars=SumLev state county Year, keyfmats=SumLev state county | , DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program), SortedBy=State county, UsageNotes=%nrbquote(), SubType=sahietotals, SetGroup=us, VarSet=, URLMeta=%str(http://www.census.gov/did/www/sahie/index.html), debug=1); %doset(mode=,libname=saipe, memname=mosahie07,template=sahie07,geouniv=Missouri,setgroup=mo) ; %doset(libname=saipe, memname=sahie08,fixindex=0, geouniv=UnitedStates, units=State County, Year=2008, CreatePgm=cnvt_sahie, Keywords=health insurance coverage, Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage. The estimates provide detail by age, race, gender and income levels for one calendar year.), keyvars=Totflag asri SumLev state county Year agecat racecat sexcat iprcat, keyfmats=| | SumLev state county | agecat racecat sexcat iprcat, DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program), SortedBy=State county, UsageNotes=%nrbquote(), SubType=sahie, SetGroup=us, VarSet=, URLMeta=%str(http://www.census.gov/did/www/sahie/index.html), debug=1); %doset(libname=saipe, memname=sahietotals08, geouniv=UnitedStates, units=State County, Year=2008, CreatePgm=cnvt_sahie, Keywords=health insurance coverage, Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage. This is a subset of the more detailed estimates in sahie08. This set has data only for the total population under age 65.), keyvars=SumLev state county Year, keyfmats=SumLev state county | , DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program), SortedBy=State county, UsageNotes=%nrbquote(), SubType=sahietotals, SetGroup=us, VarSet=, URLMeta=%str(http://www.census.gov/did/www/sahie/index.html), debug=1); %doset(mode=,libname=saipe, memname=mosahie08,template=sahie08,geouniv=Missouri,setgroup=mo) ; %doset(libname=saipe, memname=sahie09,fixindex=0, geouniv=UnitedStates, units=State County, Year=2009, CreatePgm=cnvt_sahie, Keywords=health insurance coverage, Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage. The estimates provide detail by age, race, gender and income levels for one calendar year.), keyvars=Totflag asri SumLev state county Year agecat racecat sexcat iprcat, keyfmats=| | SumLev state county | agecat racecat sexcat iprcat, DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program), SortedBy=State county, UsageNotes=%nrbquote(), SubType=sahie, SetGroup=us, VarSet=, URLMeta=%str(http://www.census.gov/did/www/sahie/index.html), debug=1); %doset(libname=saipe, memname=sahietotals09, geouniv=UnitedStates, units=State County, Year=2000, CreatePgm=cnvt_sahie, Keywords=health insurance coverage, Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage. This is a subset of the more detailed estimates in sahie08. This set has data only for the total population under age 65.), keyvars=SumLev state county Year, keyfmats=SumLev state county | , DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program), SortedBy=State county, UsageNotes=%nrbquote(), SubType=sahietotals, SetGroup=us, VarSet=, URLMeta=%str(http://www.census.gov/did/www/sahie/index.html), debug=1); %doset(mode=,libname=saipe, memname=mosahie09,template=sahie09,geouniv=Missouri,setgroup=mo) ; ===========================End commented out================================ */ %*---9-5-12 we edited these to use the global year references (gyr and gyear) to make it simpler to run for each new year. ---; %doset(libname=saipe, memname=sahie&gyr,fixindex=0, geouniv=UnitedStates, units=State County, Year=&gyear, CreatePgm=cnvt_sahie, Keywords=health insurance coverage, Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage. The estimates provide detail by age, race, gender and income levels for one calendar year.), keyvars=Totflag asri SumLev state county Year agecat racecat sexcat iprcat, keyfmats=| | SumLev state county | agecat racecat sexcat iprcat, DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program), SortedBy=State county, UsageNotes=%nrbquote(), SubType=sahie, SetGroup=us, VarSet=, URLMeta=%str(http://www.census.gov/did/www/sahie/index.html), debug=1); %doset(libname=saipe, memname=sahietotals&gyr, geouniv=UnitedStates, units=State County, Year=&gyear, CreatePgm=cnvt_sahie, Keywords=health insurance coverage, Description=%nrbquote(Estimates of the number and percent of persons who have and do not have health insurance coverage. This is a subset of the more detailed estimates in sahie08. This set has data only for the total population under age 65.), keyvars=SumLev state county Year, keyfmats=SumLev state county | , DataSource=%str(U.S. Bureau of the Census: Small Area Health Insurance Estimates program), SortedBy=State county, UsageNotes=%nrbquote(), SubType=sahietotals, SetGroup=us, VarSet=, URLMeta=%str(http://www.census.gov/did/www/sahie/index.html), debug=1); %doset(mode=,libname=saipe, memname=mosahie&gyr.,template=sahie&gyr.,geouniv=Missouri,setgroup=mo) ; %***include '/pub/data/saipe/Tools/file_dosets.sas'; *<----as generated by invoke_metafix.sas in system/Tools--; *---Customize the sort priority of the Datasets.html page. (1-8-15, jgb)---; data saipe.datasets; set saipe.datasetsB; if sortprio ne '9' and sortprio ne 'X' then do; if index(memname,'sahie') then sortprio='8'; else if index(memname,'20xx') then sortprio='1'; else sortprio='5'; end; run cancel; proc datasets library=saipe nolist; modify datasets; index delete dataset memname; index create dataset=(libname memname) / unique; index create memname; quit; options mprint msglevel=i; %gendshtm(libname=saipe,debug=1,runprocc=1); %***gendshtm(libname=archives,filetype=saipe,debug=1,runprocc=1,memindex=0);