x cd /pub/data/irstaxes/Tools; %let pgm=invoke_dosetsYY; filename pgm "&pgm..sas"; /*--Invoke the %doset macro to create observations in the Datasets dataset for this directory. *<==== We just do the original collection of sets in this setup. We do the "plus" datasets in invoke_dosets_plus.sas . Only works starting with 2012. Note we do BOTH the original & "plus" data sets in this one run, making invoke_dosets_plus obsolete. ======================================================================================================================= J. Blodgett, OSEDA, Updated Aug, 2014. Run w 2014 additions Sept 2016 -- */ title "Job to Invoke doset Macro for Sets in irstaxes, creating irstaxes.datasets"; libname irstaxes '/pub/data/irstaxes'; %let libnameg=irstaxes; %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=irstaxes,debug=1); %*let year=2012; %let year=2014; %let yr=%substr(&year,3,2); *----------------------------------------------------------------------; *----------------------------Do all the "not plus" original data sets with IRS var names (4 per year)-----------------; *---We do zipsall, zipsno, cntyall, cntyno--*; %doset(mode=,libname=irstaxes, memname=uszipsallagi&yr, geouniv=US, units=%str(state ZIP), Years=&year, CreatePgm=cnvt_irstaxes&yr, Keywords=&year IRS tax returns ZIP codes income, Description=%nrbquote(Summary of tax returns for &year at ZIP and State levels w AGI interval detail), keyvars=sumlev state agi_stub, keyfmats=%str(sumlev state | ), keyIdvars=%str( | | agi), DataSource=%str(Internal Revenue Service, SOI Division), SortedBy=State SumLev ZIPcode agi_stub, UsageNotes=%nrbquote(), SubType=zip2allagi, SetGroup=us, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/irstaxes/&yr.zpdoc.doc), debug=0); %doset(mode=,libname=irstaxes, memname=uszipsnoagi&yr, geouniv=US, units=%str(state ZIP), Years=&year, CreatePgm=cnvt_irstaxes&yr, Keywords=&year IRS tax returns ZIP codes income, Description=%nrbquote(Summary of tax returns for &year at ZIP and State levels - NO AGI interval detail), keyvars=sumlev state, keyfmats=%str(sumlev state ), DataSource=%str(Internal Revenue Service, SOI Division), SortedBy=State SumLev ZIPcode , UsageNotes=%nrbquote(), SubType=zip2noagi, SetGroup=us, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/irstaxes/&yr.zpdoc.doc), debug=0); *==============================End of ZIP sets, begin county sets====================================================*; %doset(mode=,libname=irstaxes, memname=uscntysallagi&yr, geouniv=US, units=%str(state County), Years=&year, CreatePgm=cnvt_irstaxes&yr, Keywords=&year IRS tax returns County codes income, Description=%nrbquote(Summary of tax returns for &year at County and State levels w AGI interval detail), keyvars=sumlev state agi_stub, keyfmats=%str(sumlev state | ), keyIdvars=%str( | | agi), DataSource=%str(Internal Revenue Service, SOI Division), SortedBy=State SumLev County agi_stub, UsageNotes=%nrbquote(), SubType=cnty2allagi, SetGroup=us, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/irstaxes/&yr.incydoc.doc), debug=0); %doset(mode=,libname=irstaxes, memname=uscntysnoagi&yr, geouniv=US, units=%str(state County), Years=&year, CreatePgm=cnvt_irstaxes&yr, Keywords=&year IRS tax returns County codes income, Description=%nrbquote(Summary of tax returns for &year at County and State levels - NO AGI interval detail), keyvars=sumlev state, keyfmats=%str(sumlev state ), DataSource=%str(Internal Revenue Service, SOI Division), SortedBy=State SumLev County , UsageNotes=%nrbquote(), SubType=cnty2noagi, SetGroup=us, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/irstaxes/&yr.incydoc.doc), debug=0); *--------------------------- Now do all the "plus" data sets (4 per year) with our enhancements-----------------; *---We do zipsall, zipsno, cntyall, cntyno--*; %doset(mode=,libname=irstaxes, memname=uszipsplusallagi&yr, geouniv=US, units=%str(state ZIP), Years=&year, CreatePgm=cnvt_irstaxes_&year, Keywords=&year IRS tax returns ZIP codes income, Description=%nrbquote(This enhanced Summary of tax returns for &year at ZIP and State levels w AGI interval detail), keyvars=sumlev state agi_stub, keyfmats=%str(sumlev state | ), keyIdvars=%str( | | agi), DataSource=%str(Internal Revenue Service, SOI Division), SortedBy=State SumLev ZIPcode agi_stub, UsageNotes=%nrbquote(), SubType=zip1allagi, SetGroup=us, sortprio=1, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/irstaxes/&yr.zpdoc.doc), debug=0); %doset(mode=,libname=irstaxes, memname=uszipsplusnoagi&yr, geouniv=US, units=%str(state ZIP), Years=&year, CreatePgm=cnvt_irstaxes_&year, Keywords=&year IRS tax returns ZIP codes income, Description=%nrbquote(This enhanced Summary of tax returns for &year at ZIP and State levels - NO AGI interval detail), keyvars=sumlev state, keyfmats=%str(sumlev state ), DataSource=%str(Internal Revenue Service, SOI Division), SortedBy=State SumLev ZIPcode , UsageNotes=%nrbquote(), SubType=zip1noagi, SetGroup=us,Sortprio=1, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/irstaxes/&yr.zpdoc.doc), debug=0); *==============================End of ZIP sets, begin county sets====================================================*; %doset(mode=,libname=irstaxes, memname=uscntysplusallagi&yr, geouniv=US, units=%str(state County), Years=&year, CreatePgm=cnvt_irstaxes_&year, Keywords=&year IRS tax returns County codes income, Description=%nrbquote(This enhanced Summary of tax returns for &year at County and State levels w AGI interval detail), keyvars=sumlev state agi_stub, keyfmats=%str(sumlev state | ), keyIdvars=%str( | | agi), DataSource=%str(Internal Revenue Service, SOI Division), SortedBy=State SumLev County agi_stub, UsageNotes=%nrbquote(), SubType=cnty1allagi, SetGroup=us,Sortprio=1, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/irstaxes/&yr.incydocguide.doc), debug=0); %doset(mode=,libname=irstaxes, memname=uscntysplusnoagi&yr, geouniv=US, units=%str(state County), Years=&year, CreatePgm=cnvt_irstaxes_&year, Keywords=&year IRS tax returns County codes income, Description=%nrbquote(This enhanced Summary of tax returns for &year at County and State levels - NO AGI interval detail), keyvars=sumlev state, keyfmats=%str(sumlev state ), DataSource=%str(Internal Revenue Service, SOI Division), SortedBy=State SumLev County , UsageNotes=%nrbquote(), SubType=cnty1noagi, SetGroup=us,Sortprio=1, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/pub/data/irstaxes/&yr.incydocguide.doc), debug=0); proc sort data=irstaxes.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 irstaxes.datasets (Sorted by SortPrio)'; run ; proc datasets library=irstaxes nolist; modify datasets; index delete dataset memname; index create dataset=(libname memname) / unique; index create memname; quit; options NOmprint msglevel=i; %gendshtm(libname=irstaxes,debug=0,runprocc=1);