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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 949 views
  • 3 likes
  • 4 in conversation