As @gamotte already implied, you would have to use a macro loop. One possibility is to rewrite your %dataload macro to a recursive version: %macro dataload(year=,month=,from=,to=);
%if %length(&from) and %length(&to) %then %do;
%do from=&from %to &to;
%if %substr(&from,3)=13 %then /* new year */
%let from=%eval(&from+88);
%dataload(year=%substr(&from,1,2),month=%substr(&from,3));
%end;
%return;
%end;
/* here goes the contents of the original macro */
%mend; You could then call the macro as %dataload(from=1609,to=1711);
... View more