x cd /pub/data/popests/Tools; %let pgm=invoke_dosets_nchsbri; filename pgm "&pgm..sas"; /*--Invoke the %doset macro to create observations in the Datasets dataset for this popests/nchsbri directory. J. Blodgett, OSEDA, Jan., 2006 Last revised: 6/30/14 . And then 7-6-15. And then 7-6-16. ***************Edited 7-6-16 to rerun template modules and then all the 20xx and 20xx_sumry data sets to fix years parm. ******** -- */ title "Job to Invoke doset Macro for Sets in popests/nchsbri, creating nchsbri.datasets"; %include '/pub/sas/autoexec.sas'; options mprint symbolgen; libname popests '/pub/data/popests'; libname nchsbri '/pub/data/popests/nchsbri'; ****proc sort data=nchsbri.datasets nodupkeys; *** by memname; *** run; %let libnameg=nchsbri; %let lyear=2016; %***let todo=ustrends; *<==========================NOTE!!!!!!!!!!!!!!!!!======================; %***let todo =ussuper_summary; %***let todo=usnchsbridged200x_intrcnsl; %let todo= ; *-----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=nchsbri,debug=1); *----------------------------------------------------------------------; options mprint; /* ========================begin comment==================================== *--Create the templates for the 7 datasets: 3 decades (201x, 20xx and 19xx) and 2 types (original and _sumry) The extra data set is the 201xi_sumry version: intercensal summary estimates (vs. postcensal). --; %doset(memname=_template_nchsbridged201x, filetype=popests, geouniv=~statenm, memlabel=%str(Latest NCHS bridged race ests, detail for ~statenm), units=%nrbquote(county age-sex-race-hispanic combos), Years=%str(2010-~lyear), CreatePgm=cnvt_nchs_bridged_201x, Description=%nrbquote(Special tab done by Census Bureau for National Center for Health Statistics. Similar to the Bureau casrh estimates in that they are by county, age, sex, race and hispanic origin. What is special about these estimates is that they are for single years of age and have only 4 bridged race categories.), keyvars=county age sex race hispanic, keyfmats=county, DataSource=%str(National Center for Health Statistics and U.S. Bureau of the Census), SortedBy=County, UsageNotes=%nrbquote(), SubType=nchsb201x, SetGroup=~stab, VarSet=, URLMeta=%str(http://www.cdc.gov/nchs/nvss/bridged_race/data_documentation.htm) ); %doset(memname=_template_nchsbridged20xx, memlabel=%nrbquote(Original, post-censal estimates for ~statenm), filetype=popests, geouniv=~statenm, units=%nrbquote(county age-sex-race-hispanic combos), Years=%str(2000-2009), CreatePgm=cnvt_nchs_bridged, Description=%nrbquote(Special tab done by Census Bureau for National Center for Health Statistics. Similar to the Bureau casrh estimates in that they are by county, age, sex, race and hispanic origin. What is special about these estimates is that they are for single years of age and have only 4 race categories.), keyvars=county age sex race hispanic, keyfmats=county, DataSource=%str(National Center for Health Statistics and U.S. Bureau of the Census), SortedBy=County, UsageNotes=%nrbquote(), SubType=nchsb20xx, SetGroup=~stab, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/popests/nchsbri/DocumentationBridgedPostcenV~lyear..doc) ); %doset(memname=_template_nchsbridged201x_sumry, memlabel=%nrbquote(Demographic totals summarizing the data on ~stab.nchsbridged201x for ~statenm), filetype=popests, geouniv=~statenm, units=%nrbquote(state/county age year), Years=%str(2010-~lyear), CreatePgm=nchsbridged_sumry, Keywords=NCHS bridged race Population estimates county single years of age sex hispanic origin, Description=%nrbquote(A summarized version of ~stab.nchsbridged201x dataset in which we have one row per geographic area (state or county), year and single year of age. The variables are Total, Male, Female, 4 race counts (White, Black, etc), 4 race/non-hispanic counts (WhiteNH, BlackNH, etc), Hispanic & NonHispanic. Rows where Age is blank are summaries for the complete population, all others are summaries for persons whose age is specified by the Age variable (2-char. with leading 0s). This is based on a special tab done by the Census Bureau for NCHS, and reworked by the MCDC to create this alternate view of the data.), keyvars=sumlev county age age_cohort1 age_cohort2 year , keyfmats=sumlev county, DataSource=%str(National Center for Health Statistics and U.S. Bureau of the Census), SortedBy=County Year Age, UsageNotes=%nrbquote(), SubType=nchsb201xsumry, SetGroup=~stab, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/popests/nchsbri/Readme.html#sumry_set), debug=0); %doset(memname=_template_nchsbridged20xx_sumry, memlabel=%nrbquote(Demographic totals summarizing the data on ~stab.nchsbridged20xx for ~statenm), filetype=popests, geouniv=~statenm, units=%nrbquote(state/county age year), Years=%str(2000-2009), CreatePgm=nchsbridged_sumry, Keywords=NCHS bridged race Population estimates county single years of age sex hispanic origin, Description=%nrbquote(A summarized version of ~stab.nchsbridged20xx dataset in which we have one row per geographic area (state or county), year and single year of age. The variables are Total, Male, Female, 4 race counts (White, Black, etc), 4 race/non-hispanic counts (WhiteNH, BlackNH, etc), Hispanic & NonHispanic. Rows where Age is blank are summaries for the complete population, all others are summaries for persons whose age is specified by the Age variable (2-char. with leading 0s). This is based on a special tab done by the Census Bureau for NCHS, and reworked by the MCDC to create this alternate view of the data.), keyvars=sumlev county age age_cohort1 age_cohort2 year , keyfmats=sumlev county, DataSource=%str(National Center for Health Statistics and U.S. Bureau of the Census), SortedBy=County Year Age, UsageNotes=%nrbquote(), SubType=nchsb20xxsumry, SetGroup=~stab, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/popests/nchsbri/Readme.html#sumry_set), debug=1); %*---We drop the _ after template in name here because we hit 32-char set name limit!---; %doset(memname=_templatenchsbridged20xxi_sumry, memlabel=%nrbquote(Just like &stab.nchsbridged20xx_sumry set except uses intercensal estimates), filetype=popests, geouniv=~statenm, units=%nrbquote(state/county age year), Years=%str(2000-2009), CreatePgm=nchsbridged_sumry, Keywords=NCHS bridged race Population estimates county single years of age sex hispanic origin, Description=%nrbquote(A summarized version of the ~stab subset of usnchsbridged200x_intrcnsl dataset in which we have one row per geographic area (state or county), year and single year of age. The variables are Total, Male, Female, 4 race counts (White, Black, AmInd, Asian), 4 race/non-hispanic counts (WhiteNH, BlackNH, etc), Hispanic & NonHispanic. Rows where Age is blank are summaries for the complete population, all others are summaries for persons whose age is specified by the Age variable (2-char. with leading 0s). This is based on a special tab done by the Census Bureau for NCHS, and reworked by the MCDC to create this alternate view of the data.), keyvars=sumlev county age age_cohort1 age_cohort2 year , keyfmats=sumlev county, DataSource=%str(National Center for Health Statistics and U.S. Bureau of the Census - Intercensal ests), SortedBy=County Year Age, UsageNotes=%nrbquote(), SubType=nchsb20xxisumry, SetGroup=~stab, VarSet=, URLMeta= %str(//ftp.cdc.gov/pub/Health_Statistics/NCHS/datasets/nvss/bridgepop/2000_09/DocumentationRevisedBridgedIntercen2000_09.pdf), debug=1); %doset(memname=_template_nchsbridged19xx, filetype=popests, geouniv=~statenm, units=%nrbquote(county age-sex-race-hispanic combos), Years=%str(1990-1999), CreatePgm=cnvt_nchs_bridged90s, Description=%nrbquote(Special tab done by Census Bureau for National Center for Health Statistics. Similar to the Bureau casrh estimates in that they are by county, age, sex, race and hispanic origin. What is special about these estimates is that they are for single years of age and have only 4 race categories.), keyvars=county age sex race hispanic, keyfmats=county, DataSource=%str(National Center for Health Statistics and U.S. Bureau of the Census), SortedBy=County, UsageNotes=%nrbquote(), SubType=nchsb19xx, SetGroup=~stab, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/popests/nchsbri/DocumentationBridgedIntercenA1.doc) ); %doset(memname=_template_nchsbridged19xx_sumry, memlabel=%nrbquote(Demographic totals summarizing the data on ~stab.nchsbridged19xx for ~statenm), filetype=popests, geouniv=~statenm, units=%nrbquote(state/county age year), Years=%str(1990-1999), CreatePgm=nchsbridged_sumry, Keywords=NCHS bridged race Population estimates county single years of age sex hispanic origin, Description=%nrbquote(A summarized version of ~stab.nchsbridged19xx dataset in which we have one row per geographic area (state or county), year and single year of age. The variables are Total, Male, Female, 4 race counts (White, Black, etc), 4 race/non-hispanic counts (WhiteNH, BlackNH, etc), Hispanic & NonHispanic. Rows where Age is blank are summaries for the complete population, all others are summaries for persons whose age is specified by the Age variable (2-char. with leading 0s). This is based on a special tab done by the Census Bureau for NCHS, and reworked by the MCDC to create this alternate view of the data.), keyvars=sumlev county age age_cohort1 age_cohort2 year , keyfmats=sumlev county, DataSource=%str(National Center for Health Statistics and U.S. Bureau of the Census), SortedBy=County Year Age, UsageNotes=%nrbquote(), SubType=nchsb19xxsumry, SetGroup=~stab, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/popests/nchsbri/Readme.html), debug=1); ==========================end comment====================================== */ %macro doit(state,stab); %doset(memname=&stab.nchsbridged201x,template=_template_nchsbridged201x,filetype=popests, debug=1); %doset(memname=&stab.nchsbridged201x_sumry,template=_template_nchsbridged201x_sumry,filetype=popests, debug=1); /*<=========================Comment out===================================== %doset(memname=&stab.nchsbridged20xx,template=_template_nchsbridged20xx,filetype=popests, years=%str(2000-2009), debug=0); %doset(memname=&stab.nchsbridged20xx_sumry,template=_template_nchsbridged20xx_sumry,filetype=popests, debug=0) ; %doset(memname=&stab.nchsbridged20xxi_sumry,template=_templatenchsbridged20xxi_sumry,filetype=popests, debug=1) %doset(memname=&stab.nchsbridged19xx,template=_template_nchsbridged19xx,filetype=popests, debug=1) ; %doset(memname=&stab.nchsbridged19xx_sumry,template=_template_nchsbridged19xx_sumry,filetype=popests, debug=1); ===========================End commented out================================ */ %mend doit; options NOmprint; %**dostates(01 02 04 05 06 08 09 10 11 12 13 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29,names=1); %**dostates(30 31 32 33 34 35 36 37 38 39 40 41 42 44 45 46 47 48 49 50 51 53 54 55 56,names=1); %***dostates(04,names=1); %dostates(n=51,names=1); /* =======================Begin comment================ *----And now do the entries for the cen2k datasets----------------------; %doset(memname=usnchsbridged2kcen, filetype=popests, geouniv=UnitedStates, units=%nrbquote(county age-sex-race-hispanic combos), Years=2000, CreatePgm=cnvt_nchs_bridged2kcen, Description=%nrbquote(Special tab done by Census Bureau for National Center for Health Statistics. These are complete-count data from the 2k census with the race categories edited ("bridged").), keyvars=state county age sex race hispanic, keyfmats=state county, DataSource=%str(National Center for Health Statistics and U.S. Bureau of the Census), SortedBy=State County, UsageNotes=%nrbquote(), SubType=nchsb2kcen, SetGroup=us, VarSet= ); %doset(memname=usnchsbridged2kcen_sumry, memlabel=%nrbquote(Demographic totals summarizing the data on usnchsbridged2kcen), filetype=popests, geouniv=UnitedStates, units=%nrbquote(state/county age), Years=%str(2000), CreatePgm=cnvt_nchs_bridged2kcen, Keywords=NCHS bridged race Population 2k Census counts county single years of age sex hispanic origin, Description=%nrbquote(A summarized version of usnchsbridged2kcen dataset in which we have one row per geographic area (state or county), and single year of age. The variables are Total, Male, Female, 4 race counts (White, Black, etc), 4 race/non-hispanic counts (WhiteNH, BlackNH, etc), Hispanic & NonHispanic. Rows where Age is blank are summaries for the complete population, all others are summaries for persons whose age is specified by the Age variable (2-char. with leading 0s). This is based on a special tab done by the Census Bureau for NCHS, and reworked by the MCDC to create this alternate view of the data.), keyvars=sumlev state county age age_cohort1 age_cohort2 , keyfmats=sumlev state county, DataSource=%str(National Center for Health Statistics and U.S. Bureau of the Census), SortedBy=State County Age, UsageNotes=%nrbquote(), SubType=nchsb2kcensumry, SetGroup=us, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/popests/nchsbri/Readme.html), debug=0); %doset(memname=monchsbridged2kcen, memlabel=Missouri subset of usnchsbridged2kcen with 2K Census Counts, filetype=popests, geouniv=Missouri, units=%nrbquote(county age-sex-race-hispanic combos), Years=2000, CreatePgm=cnvt_nchs_bridged2kcen, Description=%nrbquote(Special tab done by Census Bureau for National Center for Health Statistics. These are complete-count data from the 2k census with the race categories edited ("bridged").), keyvars=state county age sex race hispanic, keyfmats=state county, DataSource=%str(National Center for Health Statistics and U.S. Bureau of the Census), SortedBy=County, UsageNotes=%nrbquote(), SubType=nchsb2kcen, SetGroup=mo, VarSet= ); %doset(memname=monchsbridged2kcen_sumry, memlabel=%nrbquote(Demographic totals summarizing the data on usnchsbridged2kcen), filetype=popests, geouniv=Missouri, units=%nrbquote(state/county age), Years=%str(2000), CreatePgm=cnvt_nchs_bridged2kcen, Keywords=NCHS bridged race Population 2k Census counts Missouri county single years of age sex hispanic origin, Description=%nrbquote(A summarized version of monchsbridged2kcen dataset in which we have one row per geographic area (state or county), and single year of age. The variables are Total, Male, Female, 4 race counts (White, Black, etc), 4 race/non-hispanic counts (WhiteNH, BlackNH, etc), Hispanic & NonHispanic. Rows where Age is blank are summaries for the complete population, all others are summaries for persons whose age is specified by the Age variable (2-char. with leading 0s). This is based on a special tab done by the Census Bureau for NCHS, and reworked by the MCDC to create this alternate view of the data.), keyvars=sumlev state county age age_cohort1 age_cohort2 , keyfmats=sumlev state county, DataSource=%str(National Center for Health Statistics and U.S. Bureau of the Census), SortedBy=County Age, UsageNotes=%nrbquote(), SubType=nchsb2kcensumry, SetGroup=us, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/popests/nchsbri/Readme.html), debug=0); *------And now, 4-22-08 and each year we update it, the ustrends dataset---; %doset(memname=ustrends10, memlabel=%nrbquote(Demographic trend summaries focusing on change), filetype=popests, geouniv=UnitedStates, units=%nrbquote(state/county time period demographic), Years=%str(1990 to &lyear), CreatePgm=poptrends10, Keywords=NCHS bridged race Population trends age race hispanic origin, Description=%nrbquote(Each obs summarizes a geographic area (State or county), a time period and a demographic category with numerics indicating starting and ending values and measures of change over the period), keyvars=sumlev state county Period Demographic PerNo, keyfmats=sumlev state county | demog |, keyidvars= | | | | | Period, DataSource=%str(National Center for Health Statistics and U.S. Bureau of the Census), SortedBy=County demog perno, UsageNotes=%nrbquote(), SubType=poptrends10, SetGroup=us, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/popests/nchsbri/Readme.html), debug=0); ======================End comment================== */ /* ========================begin comment==================================== %doset(memname=ussuper_summary,filetype=popests,geouniv=UnitedStates,units=%str(state/county year), years=1990 2000 2009,createpgm=nchsbri_super_summary, keywords=demographic summaries, keyvars=state sumlev county year, keyfmats=state sumlev county |, Description=%nrbquote(Basic demographic counts and corr Pctages for age, race, sex, hispanic categories. 3 obs per state or county with Year ID variable with values 1990 2000 and 2009.), DataSource=%str(National Center for Health Statistics and U.S. Bureau of the Census), SortedBy=State County year, subtype=super, setgroup=us, debug=0) %doset(memname=usnchsbridged200x_intrcnsl, template=_template_nchsbridged20xx, filetype=popests, geouniv=United States, units=%nrbquote(county age-sex-race-hispanic combos), Years=%str(2000-2009), CreatePgm= cnvt_usnchsbridged200x_intrcnsl, Description=%nrbquote(Special tab done by Census Bureau for National Center for Health Statistics. Similar to the Bureau casrh estimates in that they are by county, age, sex, race and hispanic origin. What is special about these estimates is that they are for single years of age and have only 4 race categories.), keyvars=state county age sex race hispanic, keyfmats=state county, DataSource=%str(National Center for Health Statistics and U.S. Bureau of the Census), SortedBy=County, UsageNotes=%nrbquote(), SubType=nchsb20xxi, SetGroup=us, VarSet=, URLMeta= %str(ftp://ftp.cdc.gov/pub/Health_Statistics/NCHS/datasets/nvss/bridgepop/2000_09/DocumentationRevisedBridgedIntercen2000_09.pdf) ); ==========================end comment====================================== */ proc sort data=nchsbri.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 nchsbri.datasets (Sorted by SortPrio)'; run ; proc datasets library=nchsbri nolist; modify datasets; index delete dataset memname; index create dataset=(libname memname) / unique; index create memname; quit; options mprint msglevel=i; %gendshtm(libname=nchsbri,debug=1,runprocc=1);