Hallo to all,
I desire to make my algorithm more flexible. From this reason I tried to used macro variables. I have problem to use marco variable on terminology of my data set.I want for example to have one marco variable as name,and with it i change the name of data sets.
Can someone help me?
Two key things.
1) You are following the name of the macro variable you are trying to reference with a character that could be part of the name. You can use a period to let the macro processor know where the name ends.
2) The macro processor ignores quoted strings that are bounded on the outside by single quotes. Use double quotes for your strings that you want the macro processor to evaluate.
create table &colour._dataset as
select t.*
from colours t
where t.colours="&colours"
;
@Barney1998 Please re-read your question and consider if anyone can understand what you're asking for based on what you wrote and without any of the context that might exists in your brain.
Please post the code you want to make dynamic, and indicate which parts of it should be dynamic.
Two key things.
1) You are following the name of the macro variable you are trying to reference with a character that could be part of the name. You can use a period to let the macro processor know where the name ends.
2) The macro processor ignores quoted strings that are bounded on the outside by single quotes. Use double quotes for your strings that you want the macro processor to evaluate.
create table &colour._dataset as
select t.*
from colours t
where t.colours="&colours"
;
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.