Hey all. I am just using a quick and dirty loop for choose and ARIMA (AR for now, will add the MA later) for identifying potential models. I will use AIC as a model selection criteria. The program I have will get SAS output from the ARIMA command, then copy only the AIC to another dataset, then loop back and start over. I can then look at the individual outputs and see the results. I would like to be able to append the results as I go to create one data file with all the AIC's and orders in them. I am stuck on how to append the individual datasets into one. Can appends be done dynamically, or must they be done at the end? Since each AIC dataset is called AIC_1, AIC_2, etc., am I able to just append them all at the end some how using pattern matching on AIC_*? Here is my code so far: %macro forecast_arima_auto; /* Macro language does not use quotes around the values of macro variables Macro language %DO loops are limited, and can iterate over a range of numeric values only */ ods tagsets.sasreport13(id=EGSR) gtitle gfootnote; /* This ensures titles go into graph area */ %let hist_date='01apr2017'd; %let length_fcst=12; %local ar; %do ar=1 %to 4; proc arima data=EGTASK.NAV_TIME_SERIES; where Date <= &hist_date; identify var=OV_ECU_M11_SA(1) stationarity=(adf=10); run; estimate p=&ar maxiter=100 method=ml outstat=egtask.AR_&ar; run; data AIC_&ar; set EGTASK.AR_&ar; where _STAT_='AIC'; drop _TYPE_; AR=&ar; run; %end; %mend; %forecast_arima_auto; Thanks for any help -Bill
... View more