Hello,
This is the dumbest and slowest way of doing it.
Let us know if you need something more performant, more concise and more smart!
data abc;
set sashelp.pricedata;
where region=3;
where also line=4;
where also product=13;
run;
PROC SQL noprint;
create table varnamesarima as
select *
from dictionary.columns
where libname='WORK' and memname='ABC'
and type='num' and name NOT IN ('date','cost','region','line','product');
QUIT;
data _NULL_;
if 0 then set varnamesarima nobs=count;
call symputx('numbervars',put(count,12.));
STOP;
run;
%PUT &=numbervars;
%MACRO DO_BRANCH;
%do i=1 %to &numbervars;
data _NULL_;
set varnamesarima(firstobs=&i. obs=&i.);
call symputx('currentvar',name);
run;
%PUT §§§§§§§§§§ CURRENT VAR §§§§§§§§§§;
%PUT &=currentvar;
%PUT §§§§§§§§§§ CURRENT VAR §§§§§§§§§§;
proc timeseries data=Work.abc seasonality=12 plots=(series corr);
id date interval=month;
var ¤tvar. / accumulate=none transform=none dif=0 sdif=0;
run;
proc arima data=Work.abc;
identify var=¤tvar.; run;
/*** for multiplicative SARIMA model ***/
estimate q=(1) p=(1)(12) noconstant method=ml; run;
QUIT;
%end;
%MEND DO_BRANCH;
%DO_BRANCH
QUIT;
/* end of program */
Koen
... View more