x cd /pub/data/irstaxes/Tools; %let pgm=invoke_dosets_20xx; filename pgm "&pgm..sas"; /* Invoke the %doset macro to create observations in the Datasets dataset for this directory. */ %include "/pub/sas/autoexec.sas"; title "Job to invoke doset macro for sets in irstaxes, creating irstaxes.datasets"; libname irstaxes '/data/irstaxes'; %let libnameg = irstaxes; %let todo = ; * Run this step ONLY ONCE. If you need to rerun (start over), 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 = 2021; %let yr = %substr(&year, 3, 2); * Original dataset with IRS var names ; %doset( mode=, libname=irstaxes, memname=returns&yr, geouniv=US, units=%str(state county ZIP), Years=&year, CreatePgm=cnvt_irstaxes_&year, Keywords=&year IRS tax returns ZIP county income, Description=%nrbquote(Summary of tax returns for &year at state, county, and ZIP levels), keyvars=sumlev state agi_stub, keyfmats=%str(sumlev state | ), keyIdvars=%str( | | agi), DataSource=%str(Internal Revenue Service, SOI Division), SortedBy=sumlev state geoid agi_stub, UsageNotes=%nrbquote( ), SetGroup=us, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/data/irstaxes/&yr.incydocguide.docx), debug=0 ); * Enhanced ("plus") dataset ; %doset( mode=, libname=irstaxes, memname=returnsplus&yr, geouniv=US, units=%str(state county ZIP), Years=&year, CreatePgm=cnvt_irstaxes_&year, Keywords=&year IRS tax returns ZIP county income, Description=%nrbquote(Enhanced summary of tax returns for &year at state, county, and ZIP levels), keyvars=sumlev state agi_stub, keyfmats=%str(sumlev state | ), keyIdvars=%str( | | agi), DataSource=%str(Internal Revenue Service, SOI Division), SortedBy=sumlev state geoid agi_stub, UsageNotes=%nrbquote( ), SetGroup=us, sortprio=1, VarSet=, URLMeta=%str(https://mcdc.missouri.edu/data/irstaxes/&yr.incydocguide.docx), 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);