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.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: