04-29-2018 05:01 PM
I am trying to run a loop in a Macro program.
I would like to go back to the loop if there is no observation in test2 . Is there any way for that ? Thank you very much.
%macro test ;
%do i= 1 %to 41;
04-29-2018 06:05 PM
Here is one way. Does it suit you?
%do i= 1 %to 41; proc sql; create table test2 as select * from test1 where .....; run; %if &sqlobs=0 %then %goto next_iteration; .......... %next_iteration: %end;