%macro varyrs( /* This utility macro accepts 3 positional parms that specify a variable root name along with 2 integers specify a numeric range - of years, presumably. The generated code is a list of variable names formed by appended each year in the interval to the base name. For example: varyrs(abc,1,3) results in output: abc01 abc02 abc03 . The macro checks for single-digit numerics and inserts leading zeroes when it finds them. John Blodgett, OSEDA, orginallly code 8-04 . */ name, /* root name of the variable list to be generating */ y1, /* begin year */ y2, /* end year. y2 must be >= y1 */ revdate=09Aug04, ); %do y=&y1 %to &y2; %if %length(&y)=1 %then %let y=0&y; &name&y %end; %mend varyrs;