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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.