When I run a proc arima it works fine. See log below.
When I run as a macro, it doesn't. I can't figure out why...
Here is the macro:
Here is the error when I run the macro.
Any ideas why this is happening?
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";
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";
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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.