I want to skip iteration 19.
The following doesnt seem to work.
%macro zz;
data sasdata.som_all;
set %do i = 10 %to 18, 20 %to 23;
sasdata.som&i.
%end;;
run;
%mend zz;
%zz;
How about
%macro zz;
data sasdata.som_all;
set %do i = 10 %to 23;
%IF &i NE 19 %Then sasdata.som&i.;
%end;;
run;
%mend zz;
How about
%macro zz;
data sasdata.som_all;
set %do i = 10 %to 23;
%IF &i NE 19 %Then sasdata.som&i.;
%end;;
run;
%mend zz;
have a look at http://communities.sas.com/ideas/1084 a ballot item which seems most relevant to your question. See the comment on 18-May-2013.
Of course this is the same as program but I bit more general "to me". For lists of data set you don't even need the macro you could write set som10-som18 some20-some24; And as mentioned there is the effort to get the syntax of the more robust DO applied to the %DO. I think we've been waiting on that since 1982.
we've been waiting on that since 1982.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.