x cd /pub/data/taxsales/Tools; %let pgm=invoke_dosets; filename pgm "&pgm..sas";
%include '/pub/sas/autoexec.sas';
options mprint symbolgen;
libname taxsales '/pub/data/taxsales';
* Run only once! ;
%*doset(mode=initialize,libname=taxsales,debug=0);
%macro doyears(yr1=2017, yrend=2022);
%do year = &yr1 %to &yrend;
%let yr = %substr(&year, 3, 2);
%let sortp = %eval(2024 - &year);
data taxsales.mo_naics_st_&year (outrep='LINUX_X86_64'); set taxsales.mo_naics_st_&year; run;
data taxsales.mo_naics_cnty_&year (outrep='LINUX_X86_64'); set taxsales.mo_naics_cnty_&year; run;
%if &year ge 2003 %then %do; %* We do not have a state totals data set for the years prior to 2003. ;
%doset(
mode=update,
libname=taxsales,
memname=mo_naics_st_&year,
memlabel=%nrbquote(Mo State totals for &year by NAICS code),
geouniv=Missouri,
units=%str(state - NAICS),
Year=&year,
Keywords=taxables sales Missouri NAICS industry &year,
Description=%nrbquote(
Total taxables sales for calendar year &year in Missouri broken down by 6-digit NAICS codes
),
keyvars=NAICS,
keyidvars=NAICS_desc | |,
keyquals=,
DataSource=%str(Missouri Dept of Revenue online reports),
SortedBy=,
UsageNotes=%nrbquote(
- Data set was created by parsing the online report file which we downloaded from DOR web site.
- Sales figures are in thousands of dollars and will display rounded to nearest thousand. To get more detail when doing a Dexter query, type the following in Sec. V-c of the form, in the Formats text box:
AnSales--Q4Sales dollar13.4.
),
sortprio=&sortp,
SubType=state,
SetGroup=,
VarSet=,
URLMeta=%str(http://www.dorx.mo.gov/publicreports/),
filters=,
debug=0
)
%end;
%doset(
mode=update,
libname=taxsales,
memname=mo_naics_cnty_&year,
memlabel=%nrbquote(Mo County totals for &year by NAICS),
geouniv=Missouri,
units=%str(county - NAICS),
Year=&year,
CreatePgm=sic_cnty,
Keywords=taxables sales Missouri county NAICS industry &year,
Description=%nrbquote(Total taxables sales for calendar year &year in Missouri broken down by county and 6-digit NAICS codes
),
keyvars=fipco NAICS,
keyidvars=areaname NAICS_desc | |,
keyquals=,
DataSource=%str(Missouri Dept of Revenue online reports),
SortedBy=,
UsageNotes=%nrbquote(
- Data set was created by parsing the online report file which we downloaded from DOR web site.
- Sales figures are in thousands of dollars and will display rounded to nearest thousand. To get more detail when doing a Dexter query, type the following in Sec. V-c of the form in the Formats text box:
AnSales--Q4Sales dollar13.4.
- State-level summaries of comparable data are in data set mo_naics_st_&year.
),
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 to get usage note re dollar13.4 formats. ;
%*doyears(yr1=2014, yrend=2017);
%doyears(yr1=2017, yrend=2022);
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);