BookmarkSubscribeRSS Feed
AllSoEasy
Obsidian | Level 7

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!!

3 REPLIES 3
Astounding
PROC Star

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.

Reeza
Super User

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

Tom
Super User Tom
Super User

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;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1620 views
  • 3 likes
  • 4 in conversation