x cd /pub/data/stf904/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, 12/2005 -- */ title "Job to Invoke doset Macro for Sets in stf904, creating stf904.datasets"; libname stf904 '/pub/data/stf904'; *-----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=stf904,debug=1); *----------------------------------------------------------------------; *<==========================TEMPLATEs====================================; %doset(mode=,libname=stf904, memname=_template_filea, memlabel=, geouniv=Missouri, units=%str(Many, down to tract/BNA within metro area), Years=1990, CreatePgm=stf904c, Keywords=1990 Summary Tape File 4, keyvars=Slvl state county msacmsa placefp geocomp chariter, keyfmats=Slvl state county metro fplace geocomp charitr, keyquals=| | | | state , DataSource=%str(U.S. Bureau of the Census), SortedBy=, UsageNotes=%nrbquote(), SubType=, SetGroup=moa, SortPrio=4, VarSet=variablesb, URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf904/cb6308.all.pdf), debug=0); %doset(mode=,libname=stf904, memname=_template_fileb,template=_template_filea, geouniv=Missouri, units=%str(Many, down to place of 2500 or more), setgroup=mob, VarSet=variablesb, SortPrio=4, debug=0); %doset(mode=,libname=stf904, memname=_template_filec, geouniv=United States, units=%str(US, State, County, Place (10,000+), Urbanized Area, etc), Years=1990, createpgm=cnvt_usfiles, keyvars=sumlev geocomp state county msacmsa placefp urbarea, keyquals= | | | | | state, keyfmats=sumlev geocomp state county metro fplace urbarea, UsageNotes=%nrbquote(), VarSet=variablesb, URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf904/cb6308.all.pdf), debug=0); *<====================================A Table Files=====================================; %doset(mode=,libname=stf904, template=_template_filea, memname=filea_moatbls, memlabel=%nrbquote(File A, Missouri A Tables), Description=%nrbquote(Very detailed tabulations based on the 1990 census long form: for total population.), UsageNotes=%nrbquote(; %doset(mode=,libname=stf904, template=_template_filea, memname=filea_mobtb&iter, memlabel=%nrbquote(File A, Missouri B Tables for &itername), Description=%nrbquote(Detailed tabulations based on the 1990 census long form: for the &itername population, Missouri File A), UsageNotes=%nrbquote(&unotes), SubType=btabs, SetGroup=moa, VarSet=variablesb, URLMeta=, debug=0); %doset(mode=,libname=stf904, template=_template_fileb, memname=fileb_mobtb&iter, memlabel=%nrbquote(File B, Missouri B Tables for &itername), Description=%nrbquote(Detailed tabulations based on the 1990 census long form: for the &itername population, Missouri File B), UsageNotes=%nrbquote(&unotes), SubType=btabs, SetGroup=mob, VarSet=variablesb, URLMeta=, debug=0); %if iter=his %then %let unotes=%str(
  • Hispanic persons can be of any race.); %else %let unotes=; %let unotes=+&unotes; %doset(mode=,libname=stf904, template=_template_filec, memname=usbtb&iter, memlabel=%nrbquote(File C, U.S. B Tables for &itername), Description=%nrbquote(Detailed tabulations based on the 1990 census long form: for the &itername population, United States (File C)), UsageNotes=%nrbquote(&unotes), SubType=btabs, Varset=variablesb, SetGroup=us, debug=0); %if (&iter ne his) and (&iter ne tot) %then %do; %*---generate entries for each of the non-hispanic chariters---; %put ****And now generating the non-hipsanic entries for &iter &itername; %if &iter=ami %then %let iter1=i; %else %let iter1=%substr(&iter,1,1); %if &iter ne ami and &iter ne api %then %do; %doset(mode=,libname=stf904, template=_template_filea, memname=filea_mobtb&iter1.nh, memlabel=%nrbquote(File A, Missouri B Tables for &itername, non Hispanic), Description=%nrbquote(Detailed tabulations based on the 1990 census long form: for the &itername / non Hispanic population, Missouri File A), SubType=btabs,Varset=variablesb, SetGroup=moa, debug=0); %end; %*---We were surprised to find that we did not have data for the non-hispanic chariter for mo fileb--; %***doset(mode=,libname=stf904, template=_template_fileb, memname=fileb_mobtb&iter, memlabel=%nrbquote(File B, Missouri B Tables for &itername), Description=%nrbquote(Detailed tabulations based on the 1990 census long form: for the &itername / non Hispanic population, Missouri File B), SubType=btabs, SetGroup=mob, debug=0); %doset(mode=,libname=stf904, template=_template_filec, memname=usbtb&iter1.nh, memlabel=%nrbquote(File C, U.S. B Tables for &itername, non Hispanic), Description=%nrbquote(Detailed tabulations based on the 1990 census long form: for the &itername / non Hispanic population, United States (File C)), UsageNotes=%nrbquote(&unotes), SubType=btabs,Varset=variablesb, SetGroup=us, debug=0); %end; %*--generating xxxnh dataset entries---; %let niter=%eval(&niter+1); %let iter=%scan(&iters,&niter); %let itername=%scan(&iternames,&niter,%str(:)); %end; %*--of %do %while group---; %mend btabs; options NOmprint; %btabs (); *<===========================Other - the usgeos dataset=================; %doset(mode=,libname=stf904, memname=usgeos,universe=United States, memlabel=%str(US geographic header fields only), geouniv=United States, units=%str(US, State, County, Place (10,000+), Urbanized Area, etc), Years=1990, createpgm=cnvt_usfiles, keyvars=sumlev geocomp state county msacmsa placefp urbarea, keyquals= | | | | | state, keyfmats=sumlev geocomp state county metro fplace urbarea, Description=%nrbquote(This dataset contains just the geographic identifier fields for the entire U.S.. stripped off the usatbls dataset.), UsageNotes=%nrbquote(), URLmeta=%str(https://mcdc.missouri.edu/pub/data/stf904/stf904.cendicts.idvars), SubType=geos, SortPrio=1, setgroup=us); proc sort data=stf904.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 stf904.datasets (Sorted by SortPrio)'; run ; proc datasets library=stf904 nolist; modify datasets; index delete dataset memname; index create dataset=(libname memname) / unique; index create memname; quit; %gendshtm(libname=stf904,debug=1,runprocc=1);