x cd /pub/data/stf803/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, Jan, 2005 -- */ title "Job to Invoke doset Macro for Sets in stf803, creating stf803.datasets"; libname stf803 '/pub/data/stf803'; %let libnameg=stf803; *-----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=stf803,debug=1); *----------------------------------------------------------------------; %doset(mode=,libname=stf803, memname=_template_iset, memlabel=%nrstr(~statenm Inventory level summaries from File A), geouniv=~statenm, units=Inventory Summary Levels, Year=1980, CreatePgm=migrate_plus, Keywords=1980 census ~statenm stf3, Description=%nrbquote(~statenm summary tables for the state and all its counties, cities, and county subdivisions from the 1980 decennial census.), keyvars=SumLev State fipco smsa fipsplac, keyfmats=sumlev state county smsa80_ fplace, keyquals= | | | | state, DataSource=%str(1980 Census - Summary Tape File 3A for ~statenm), UsageNotes=%nrbquote(), SubType=a, SetGroup=~stab, VarSet=variables, URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803/Varlabs.txt), debug=0); /* =======================Begin comment================ %doset(mode=,libname=stf803, memname=_template_hset, memlabel=%nrstr(~statenm hierarchal level summaries from File A), geouniv=~statenm, units=Hierarchal Summary Levels, Year=1980, CreatePgm=migrate_plus, Keywords=1980 census ~statenm stf3, Description=%nrbquote(~statenm summary tables for the 4-level hierarchy of summaries (all within County Subdivision): place, tract, block group and enumeration district), keyvars=SumLev State fipco smsa fipsplac, keyfmats=sumlev state county smsa80_ fplace, keyquals= | | | | state, DataSource=%str(1980 Census - Summary Tape File 3A for ~statenm), UsageNotes=%nrbquote(), SubType=a, SetGroup=~stab, VarSet=variables, URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803/Varlabs.txt), debug=0); *---the cset template is for all the national ("File C") datasets---; %doset(mode=,libname=stf803, memname=_template_cset, memlabel=, geouniv=United States, units=, Year=1980, CreatePgm=migrate_plus, Keywords=1980 census stf3 national collection, Description=, DataSource=%str(1980 Census - Summary Tape File 3C), UsageNotes=%nrbquote(), SubType=c, SetGroup=us, VarSet=variables, URLMeta=%str(https://mcdc.missouri.edu/pub/data/stf803/Varlabs.txt), debug=0); %doset(libname=stf803,memname=uscds96th, template=_template_cset, units=cds96, description=Summaries for 96th Congressional Districts for entire US, UsageNotes=%nrbquote(.), keyvars=state,keyfmats=state, debug=0) ; %doset(libname=stf803,memname=usmcds11,description=Minor Civil Division summaries for 11 selected states, template=_template_cset,units=MCD, UsageNotes=%nrbquote(+), keyvars=state county, keyfmats=state county, debug=0); %doset(libname=stf803,memname=usmisc, template=_template_cset,units=US Region Division SCSA SNSA UA, description=%nrbquote(Summaries for US, Regions, Divisions, SCSAs, SMSAs and UAs, including within-state portions), keyvars=sumlev state smsa , keyfmats=sumlev state smsa80_ , UsageNotes=%nrbquote(+), debug=0); %doset(libname=stf803,memname=usplaces,description=%str(Summaries for all places (cities) in the US, regardless of size and including CDPs) , template=_template_cset,units=Places, UsageNotes=%nrbquote(+), keyvars=state fipsplac, keyfmats=state fplace,keyquals= | state, DataSource=%str(1980 Census - Summary Tape File 3A State Files), debug=0); %doset(libname=stf803,memname=usstcnty, template=_template_cset,units=State County, description=%str(Summaries for States and Counties (and county equivalents) for the entire US) , UsageNotes=%nrbquote(+ ), keyvars=sumlev state county, keyfmats=sumlev state county, debug=0); %doset(libname=stf803,memname=uszips, template=_template_cset, units=ZIP, description=%str(Summaries for all 5-digit ZIP codes and ZIP-within-County/SMSA for the US) , keyvars=sumrylvl state county smsa pcounty split, keyfmats= | state county smsa80_ county, UsageNotes=%nrbquote(), DataSource=%str(1980 Census - Summary Tape File 3B (Via ICPSR Study 8071)), Sortedby=State ZIP SumryLvl County SMSA, debug=0); ======================End comment================== */ %macro doit(state,stab); %doset(libname=stf803,memname=&stab.i,template=_template_iset) ; %*doset(libname=stf803,memname=&stab.h,template=_template_hset) ; %mend doit; %dostates(n=51,names=1) ; %*dostates(29,names=1) ; *--------------------------------Post process to generate the final datasets.html page etc-----------------*; proc sort data=stf803.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 stf803.datasets (Sorted by SortPrio)'; run ; proc datasets library=stf803 nolist; modify datasets; index delete dataset memname; index create dataset=(libname memname) / unique; index create memname; quit; options mprint msglevel=i; %gendshtm(libname=stf803,debug=1,runprocc=1); libname system '/pub/data/system'; %**metafix(filetype=stf803); *<---syncronize the Contents file descriptiosn with those in datasets.---;