Dear SAS Community, I'm trying to compile multiple datasets into single superset - the same data for different months for many years (jan2001_data .... dec2016). Multiple SET doesn't work here because I only need subset of variables from original datasets. Thus I created a dataset which I expand using sql union with every dataset: %macro appendData(month=, year=);
proc sql;
create table anto.temp1 as
select
a.*
from
anto.dataaccum a
union
select
b.var1,
b.var2,
b.var3
from
data&year..&month.&year._data b;
data anto.dataaccum;
set anto.temp1;
run;
%mend;
%appendData(month=jan, year=2001);
......
%appendData(month=dec, year=2016); That would have been much more efficient if I could call %appendData from inside %do loop. However, any use of ARRAY, DO or DO_OVER outside of PROC causes error. Is it possible at all? Or do I call it incorrectly? %do_over(values=jan feb mar apr may jun jul aug sep oct nov dec, phrase=%appendData(month=?,year=2016));
WARNING: Apparent invocation of macro DO_OVER not resolved.
ERROR 180-322: Statement is not valid or it is used out of proper order.
... View more