DATA Step, Macro, Functions and more

Bizarre %AR Macro error within proc model

Reply
Frequent Contributor
Posts: 105

Bizarre %AR Macro error within proc model

Hey Guys,

So I have a fairly simple piece of proc model code:

proc model data=to_forecast1 outparms=parms_out;

  ods output "Nonlinear OLS Summary of Residual Errors" = stat_out;

  ods output "Nonlinear OLS Parameter Estimates" = stderrs_probts;

  d_Roll_Rate = B1*d_short_rate_up+ B2*lag_d_short_rate_up+ Gamma*(A1*lag_short_rate - lag_Roll_Rate);

  %AR(d_Roll_Rate,13);

  fit d_Roll_Rate / dw=1;

  run;

When I run this I obtain the following from the log:

15       !  proc model data=to_forecast1 outparms=parms_out;

16         where qrm_account=&qrm_acct.;

17         ods output "Nonlinear OLS Summary of Residual Errors" = stat_out;

18         ods output "Nonlinear OLS Parameter Estimates" = stderrs_probts;

WARNING: Apparent invocation of macro AR not resolved.

19        

20         d_Roll_Rate = B1*d_short_rate_up+ B3*lag_d_short_rate_up+ Gamma*(A1*lag_short_rate -

20       !  lag_Roll_Rate);

21        

22         %AR(d_Roll_Rate,13);

              _

              180

ERROR 180-322: Statement is not valid or it is used out of proper order.

23        

24         fit d_Roll_Rate / dw=1;

25         run;

And execution ends..I'm really baffled because I'm fairly sure this is correct syntax for %AR, and this mirrors previous working SAS code I've used almost exactly...If I remove the "%AR(d_Roll_Rate,13);" line then it works fine...I'm not sure what could possibly be wrong in there. Am I missing something obvious??

Thanks!!

Super User
Posts: 5,503

Re: Bizarre %AR Macro error within proc model

Posted in reply to AllSoEasy

Yes, you're too focused on the error, and not focused on the warning.

Your program doesn't know where to find the definition of the %AR macro.  The folder that holds the file with the macro definition must be referenced in the SASAUTOS option.  Alternatively, but not as professional, your program has to %INCLUDE the file that defines the macro.

Super User
Posts: 19,789

Re: Bizarre %AR Macro error within proc model

Posted in reply to Astounding

%AR is included with the SAS/ETS Package by default, according to the docs.

Super User
Super User
Posts: 7,042

Re: Bizarre %AR Macro error within proc model

Posted in reply to AllSoEasy

Check the SASAUTOS option. 

%put %sysfunc(getoption(SASAUTOS));

Check the SASAUTOS fileref.

%put %sysfunc(pathname(SASAUTOS));

Check to make sure you have installed (and licensed) SAS/ETS.

proc setinit; run;

Ask a Question
Discussion stats
  • 3 replies
  • 272 views
  • 3 likes
  • 4 in conversation