x cd /pub/data/popests/Tools; %let pgm=invoke_dosets_intrcnsl; filename pgm "&pgm..sas"; /*--Invoke the %doset macro to create observations in the Datasets dataset for this popests/intrcnsl directory. J. Blodgett, OSEDA, Oct., 2011 intrcnsl is an alias for intercensal20xx . -- */ title "Job to Invoke doset Macro for Sets in popests/intrcnsl, creating intrcnsl.datasets"; libname popests '/pub/data/popests'; libname intrcnsl '/pub/data/popests/intrcnsl'; ****proc sort data=intrcnsl.datasets nodupkeys; *** by memname; *** run; %let libnameg=intrcnsl; *-----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=intrcnsl,debug=1); *----------------------------------------------------------------------; options mprint; /* ========================begin comment==================================== ==========================end comment====================================== */ %doset(memname=_template_intrcnsl, filetype=popests, geouniv=United States, units=%nrbquote(state county), Years=%str(2000-2010), CreatePgm=intercensal20xx, Description=%nrbquote(Intercensal state and county estimates for decade 2000-2010. Contains revisions of the Bureau post-censal estimates for the decade using the 2010 census counts, which are also included.), keyvars=sumlev state county, keyfmats=sumlev state county, DataSource=%str(U.S. Bureau of the Census, FSCPE), SortedBy=State County, UsageNotes=%nrbquote(), SubType=intrcnsl, SetGroup=us, VarSet=, URLMeta=%str(http://www.census.gov/popest/data/intercensal/county/county2010.html) ); %doset(memname=usstcntytots,template=_template_intrcnsl, memlabel=%nrbquote(Total Pops Only: US State and County estimates), filetype=popests, units=%nrbquote(state county), UsageNotes=%nrbquote(), debug=0); %doset(memname=usstcntysexracehisp,template=_template_intrcnsl, memlabel=%nrbquote(Estimates by Sex, Race and (Hispanic) Origin for US states & counties), filetype=popests, units=%nrbquote(state county sex-race-Hispanic combos ), keyvars=sumlev state county sex race origin, UsageNotes=%nrbquote(), URLMeta=%str(http://www.census.gov/popest/data/intercensal/county/county2010.html), debug=0); %doset(memname=usstcntyagesex5yr,template=_template_intrcnsl, memlabel=%nrbquote(Estimates by age and sex for US states & counties), units=%nrbquote(state county sex-age combos), keyvars=sumlev state county sex agegrp, filetype=popests, UsageNotes=%nrbquote(), URLMeta=%str(http://www.census.gov/popest/data/intercensal/county/county2010.html), debug=0); proc sort data=intrcnsl.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 intrcnsl.datasets (Sorted by SortPrio)'; run ; proc datasets library=intrcnsl nolist; modify datasets; index delete dataset memname; index create dataset=(libname memname) / unique; index create memname; quit; options mprint msglevel=i; %gendshtm(libname=intrcnsl,debug=1,runprocc=1);