I am using an ods tagset with table editor in SAS 9.4 to generate htm output tables (a proc tabulate) across all US states across a period of 5 years. Currently I have a macro that generates individual htm tables per state per year with a title that includes state abbreviation and year (e.g., RI13). I would like to make the process more efficient and maybe add a do loop that would generate each htm across each year so that the htm would go into a folder with that specific year. Any recommendations or critiques on the code is much appreciated. %include &path\tableEditor.tpl; run;%macro testtab(st,xst1);ods tagsets.tableeditor file=&path\&xst1..htmoptions(        frozen_headers=yes       frozen_rowheaders=yes       banner_color_even=beige       banner_color_odd=white       header_bgcolor=teal       header_fgcolor=white       rowheader_bgcolor=lightblue       gridline_color=gray       header_size=12         rowheader_size=12        data_size=11;  %macro testtab(st,xst1);  ods tagsets.tableeditor file=&path\&xst1..htm  options(        frozen_headers=yes       frozen_rowheaders=yes       banner_color_even=beige       banner_color_odd=white       header_bgcolor=teal       header_fgcolor=white       rowheader_bgcolor=lightblue       gridline_color=gray       header_size=12         rowheader_size=12        data_size=11        /*sheet_name=&xst1*/      );  PROC TABULATE NOSEPS MISSING FORMAT=comma7. FORMCHAR='              '    data=t;  CLASS STATEFIP YR sub1;  class age sex race ethnic / style={background=lightyellow}; tables statefip, all*(n f=5.1*pctn<sub1 all>)  (sex all)*(pctn<sex all>)*f=5.1  (age all)*(pctn<age all>)*f=5.1  (race all)*(pctn<race all>)*f=5.1  (ethnic all)*(pctn<ethnic all>)*f=5.1,  all sub1 / rts=16 misstext='--' box=_page_ printmiss; format age ageg. sex sex. race race. ethnic ethnic. sub1 sub. statefip    $state.; keylabel all='Total' n='No.' pctn='%'; title1  height=11pt 'Title A,'; title2  height=11pt 'Title B';    title3  height=11pt 'Year = 2013'; */Need to make this a macro*/ where statefip IN (&st);    run;   ods tagsets.tableeditor close; %mend testtab; %testtab('AL',AL15) %testtab('AR',AR15)...;run;
Using SAS macro/do loop across multiple years generating 50+ html tabs per year
html;macros;sas