Is there a way to loop this macro to extend the process up to 100. Using the current code, one would have to repeat increment macro 100 times. data have; length num total 3.; input num total 3.; datalines; 1 10 2 20 3 30 4 40 5 50 ; %macro increment (from=, to=); proc sql; create table want_&from. as select "from &from. to &to." as desc, sum(total) as new_total from have where num ge &from. and num le &to. group by desc ;quit; %mend; %increment (from=1, to=2); %increment (from=2, to=3); %increment (from=3, to=4); %increment (from=4, to=5);
... View more