x cd /pub/data/popests/Tools; %let pgm=invoke_dosets_casrh; filename pgm "&pgm..sas"; /* Invoke the %doset macro to create/delete observations in the Datasets dataset for the latest casrh datasets/ J. Blodgett, OSEDA, Aug. 2007 / 2008 / May 2009 Rerunning for 2013 data sets with fix involving the tilde character being wrong in some usage notes code. Running for 2014. Running after 2016 converts, 6/17--; Running July 2019, GPR Running December 2019 after adding CASRH 2018, GPR */ title "Job to Invoke doset Macro for casrh datasets in popests"; %include '/pub/sas/autoexec.sas'; options mprint nosymbolgen; %let todo=; libname popests '/pub/data/popests'; %let Byear=2020; *--base census year. Set to value of 2000 when doing data prior to 2011---; %let cpsfx=1X; *-- convert program suffix. Set to yya for 2009 and earlier--; %let Gyear=2023; %let yearp1= %eval(&Gyear + 1); %let gyr=%substr(&gyear,3,2); *-- Make entries for earlier casrh datasets from previous year(s) disappear ; data popests.datasets; set popests.datasets; if index(memname,"casrh04") then delete; if index(memname,"casrh06") then delete; if index(memname,"casrh11") then delete; if index(memname,"casrh12") then delete; if index(memname,"casrh13") then delete; if index(memname,"casrh16") then delete; if index(memname,"casrh17") then delete; if index(memname,"casrh18") then delete; if index(memname,"casrh19") then delete; if index(memname,"casrh21") then delete; if index(memname,"casrh22") then delete; run ; %let todolist=_template_casrh usstatescasrh&gyr us1dimsums_casrh&gyr ; *-- This is a copy of the template defn in invoke_dosets. This one takes precedence but does not have to be run each year; %doset(mode=,libname=popests, memname=_template_casrh, memlabel=%nrbquote(~stab county estimates by age, sex, race, hisp: ~Byear-~Gyear), geouniv=~gstatenm, units=county_asrht_demographic_combos, Years=%str(~Byear-~Gyear), CreatePgm=casrh_cnvt20~cpsfx, Keywords=Population estimates county age sex race hispanic origin, Description=%nrbquote(Estimates of the population of ~statenm counties for July 1 of each year from ~Byear to ~Gyear broken down by detailed age, sex, race, and hispanic origin.), keyvars=sumtype county cbsa age sex race hispanic, keyfmats=sumtype county cbsa age sex race hispani, DataSource=%str(U.S. Bureau of the Census: FSCPE. Estimates released spring/summer, ~yearp1), SortedBy=County, UsageNotes=%nrbquote(), SubType=4casrh, SetGroup=~stab, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/cgi-bin/browse?/pub/data/popests/Tools/casrh_formats.sas@), debug=0); %macro doit(state,stab); %let gstate=&state; %let gstab=&stab; %let gstatenm=&statenm; %doset(libname=popests,memname=&stab.casrh&gyr,template=_template_casrh) %mend doit; %dostates(n=51,names=1); %let stab=us; %let statenm=UnitedStates; options mprint; %doset(libname=popests, memname=usstatescasrh&gyr,template=_template_casrh, memlabel=%str(US state level estimates by age, sex, race, hispanic: &byear-&gyear), geouniv=UnitedStates, description=%nrbquote (Estimates of the population of U.S. states for July 1 of each year from &byear to &gyear broken down by detailed age, sex, race, and hispanic origin.), keyvars=sumtype state age sex race hispanic, keyfmats=sumtype state age sex race hispani, units=State_asrht_combos, UsageNotes=%nrbquote(), debug=0) ; %doset(libname=popests, memname=us1dimsums_casrh&gyr,template=_template_casrh, geouniv=UnitedStates, description=%nrbquote(County level summaries for entire US for total pop and single dimensions), units=Counties_asrht1_combos, keyvars=sumlev sumtype state county cbsa age sex race hispanic, keyfmats=sumlev sumtype state county cbsa age sex race hispani, UsageNotes=%nrbquote(), subtype=4casrh2, debug=0) proc sort data=popests.datasets out=bysortprio; by sortprio; run; proc datasets library=popests nolist; modify datasets; index delete dataset memname; index create dataset=(libname memname) / unique; index create memname; quit; options mprint msglevel=i; %gendshtm(libname=popests,debug=1,runprocc=1, sortby=descending sortprio setgroup memname, groupby=LatestYear); /*<=========================Comment out===================================== proc print data=allsets; by sortprio; *<--allsets is what us used by gendshtm macro to generate datasets.html ---; var SetGroup Geouniv Subtype years Memname; title2 "Variables Used to Order Entries in the Datasets.html page"; run; ===========================End commented out================================ */