x cd /pub/data/taxsales/Tools; %let pgm=invoke_dosets; filename pgm "&pgm..sas"; *---Create metadata for Missouri taxable sales by 2- and 3-digit SIC cats by county from MO Dept. of Revenue. Coded by J. Blodgett, June, 2007 ----; %include '/pub/sas/autoexec.sas'; options mprint symbolgen; libname taxsales '/pub/data/taxsales'; %*doset(mode=initialize,libname=taxsales,debug=0); %macro doyears(yr1=2001,yrend=2007); %do year=&yr1 %to &yrend; %let yr=%substr(&year,3,2); %let sortp=%eval(2009-&year); %if &year ge 2003 %then %do; %*--we do not have a state totals data set for the years prior to 2003---; %doset(mode=,libname=taxsales, memname=mosicst&yr, memlabel=%nrbquote(Mo State totals for &year by SIC), geouniv=Missouri, units=%str(state - SIC), Year=&year, CreatePgm=sic_cnty, Keywords=taxables sales Missouri SIC industry &year, Description=%nrbquote(Total taxables sales for calendar year &year in Missouri broken down by 2 and 3-digit SIC codes), keyvars=sic siclvl status, keyidvars=sicdesc | |, keyquals=, DataSource=%str(Missouri Dept of Revenue - online reports), SortedBy=, UsageNotes=%nrbquote(), sortprio=&sortp, SubType=state, SetGroup=, VarSet=, URLMeta=%str(http://www.dorx.mo.gov/publicreports/), filters=, debug=0) %end; %doset(mode=,libname=taxsales, memname=mosiccnty&yr, memlabel=%nrbquote(Mo County totals for &year by SIC), geouniv=Missouri, units=%str(county - SIC), Year=&year, CreatePgm=sic_cnty, Keywords=taxables sales Missouri county SIC industry &year, Description=%nrbquote(Total taxables sales for calendar year &year in Missouri broken down by county and 2 and 3-digit SIC codes ), keyvars=fipco sic siclvl status, keyidvars=areaname sicdesc | |, keyquals=, DataSource=%str(Missouri Dept of Revenue - online reports), SortedBy=, UsageNotes=%nrbquote(), sortprio=&sortp, SubType=county, SetGroup=, VarSet=, URLMeta=%str(http://www.dorx.mo.gov/publicreports/), filters=, debug=0) %end; %mend doyears; options NOmprint; %***doyears (yr1=2007,yrend=2007) ; %***doyears (yr1=2008,yrend=2008) ; %***doyears(yr1=2001,yrend=2008); *<---Reran for earlier years in 2014 to get usage note re dollar13.4 formats--; %doyears(yr1=2014,yrend=2017); proc datasets library=taxsales nolist; modify datasets; index delete dataset memname; index create dataset=(libname memname) / unique; index create memname; quit; proc sort force data=taxsales.datasets nodupkey; by SortPrio GeoUniv SetGroup SubType Memname; *by LatestYear descending setgroup memname; run; %gendshtm(libname=taxsales,debug=0,runprocc=1);