/*--------------------------------------------------------------

                    SAS Sample Library

        Name: henex05.sas
 Description: Example program from SAS Forecast Server
              Procedures User's Guide,
              The HPFENGINE Procedure
       Title: HPFENGINE and HPFDIAGNOSE Procedures
     Product: SAS Forecast Server Procedures Software
        Keys: time series forecast
        PROC: HPFENGINE
       Notes:

--------------------------------------------------------------*/

ods graphics on;

proc hpfdiagnose data=sashelp.air
                 repository=work.repository
                 outest=est;
   id date interval=month;
   forecast air;
run;
proc hpfengine data=sashelp.air
               inest=est outest=outest
               repository=work.repository
               print=(select estimates summary)
               plot=forecasts;
   id date interval=month;
   forecast air;
run;

proc hpfarimaspec repository=work.repository name=myarima;
   forecast symbol=sale transform=log q=(1 12) diflist=(1 12) noint;
run;

proc hpfucmspec repository=work.repository name=myucm;
   forecast symbol=sale transform=log;
   irregular;
   level;
   season length=12;
run;

proc hpfselect repository=work.repository name=select;
   spec myarima myucm;
run;

proc hpfdiagnose data=sashelp.air
                 inselectname=select
                 repository=work.repository
                 outest=est
                 criterion=mape;
   id date interval=month;
   forecast air;
run;

proc hpfengine data=sashelp.air
               inest=est
               repository=work.repository
               print=(select estimates summary)
               plot=forecasts;
   id date interval=month;
   forecast air;
run;