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.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.