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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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