Hello all:
I have a question regarding using a do loop within a macro.
Let's say I have the following code:
%macro plot_loop();
%do i=1 %to 10;
proc print data=x;
where id=&i;
run;
%end;
%mend;
So I am going to have 10 PROC PRINT outputs (one for each ID from 1 to 10).
However, what if the ID's I want to print are various numbers in no particular order or pattern (say I want to print ID=1, 3, 7, 9, 10). Is there a way I can modify the do loop so that I can tell it for which i's to do? Something like a %do i in(1 3 7 9 10)?
I have a question regarding using a do loop within a macro.
Let's say I have the following code:
%macro plot_loop();
%do i=1 %to 10;
proc print data=x;
where id=&i;
run;
%end;
%mend;
So I am going to have 10 PROC PRINT outputs (one for each ID from 1 to 10).
However, what if the ID's I want to print are various numbers in no particular order or pattern (say I want to print ID=1, 3, 7, 9, 10). Is there a way I can modify the do loop so that I can tell it for which i's to do? Something like a %do i in(1 3 7 9 10)?