BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
sasgorilla
Pyrite | Level 9

When I run a proc arima it works fine. See log below. 

sasgorilla_0-1741919563734.png

 

When I run as a macro, it doesn't. I can't figure out why...  

 

Here is the macro:

 

 

sasgorilla_1-1741919636126.png

Here is the error when I run the macro. 

sasgorilla_2-1741919797789.png

 

 

Any ideas why this is happening? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Please, please, PLEASE paste log and code entries as text in text boxes opened on the forum with the </> icon that appears above the main message windows. 

It is quite often much easier to COPY - Edit - Paste suggested fixes to code. The more stuff that requires typing from scratch the less likely you are to get complete working code.

 

When debugging MACRO generated code then set OPTIONS MPRINT; before running the macro.

 

In this case, you have placed the value of the Type variable in the WHERE statement inside single quotes. Macro variables inside single quotes do not resolve at all. You must use double quotes

where type = "&type";

View solution in original post

2 REPLIES 2
ballardw
Super User

Please, please, PLEASE paste log and code entries as text in text boxes opened on the forum with the </> icon that appears above the main message windows. 

It is quite often much easier to COPY - Edit - Paste suggested fixes to code. The more stuff that requires typing from scratch the less likely you are to get complete working code.

 

When debugging MACRO generated code then set OPTIONS MPRINT; before running the macro.

 

In this case, you have placed the value of the Type variable in the WHERE statement inside single quotes. Macro variables inside single quotes do not resolve at all. You must use double quotes

where type = "&type";
sasgorilla
Pyrite | Level 9

Thank you! 

 

And sorry about the images! I was working in an external environment without online access and where I could not copy and paste the code. 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2 replies
  • 751 views
  • 1 like
  • 2 in conversation