A coding style hint. Do not bury the definition of a macro into the middle of a SAS step. At a minimum define them between step boundaries, if not at the absolute top of the program.
%macro smallLoop1(s,e);
%do year = &s. %to &e.;
want&year.
%end;
%mend smallLoop1;
%macro smallLoop2(s,e);
%do year = &s. %to &e.;
when ("&year.") output want&year.;
%end;
%mend smallLoop2;
data ...
... View more