@nickspencer wrote:
Any suggestions ?
Yes, show us the actual code and SASLOG that you are using. Run the code again with OPTIONS MPRINT; as the first line and then paste the SASLOG into the {i} window; and paste the actual code into the running man window.
You don't need a global macro variable.
If your code is as basic as in your example then just wrap it in a macro with a %do loop. e.g.:
%macro check_list;
%do i=1 %to 4;
Data test&i;
Set list&i.;
Run;
%end;
%mend;
Art, CEO, AnalystFinder.com
Somehow, your code creates a local macro variable named LIST2.
But nobody can help beyond that. It's in your macro code somewhere, and only you can see that code. If you were to share it, you might get a more specific answer.
Do you really need list1 to be global?
Also you can create the macro such that a parameter that you do not explicitly assign has a default value:
Instead of : %macro check_list;
use: %macro(List1=myname);
the Default value of LIST1 inside the macro then becomes myname.
Be extremely careful of quotes as part of macro variables. Often they make coding much harder. The actual code and how LIST1 is used outside of the macro would help.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.