Rule #1 of macro development: start with working SAS code.
By manually resolving your macro parameters, I get this code:
data dsn;
set dsn;
where Type eq ('Sedan' & 'Asia' and Origin 'Sedan' & 'Asia');
run;
The where condition is very obviously invalid syntax. Fix that in the data step code, and then start to make it dynamic by proper use of macro variables.
Rule #1 of macro development: start with working SAS code.
By manually resolving your macro parameters, I get this code:
data dsn;
set dsn;
where Type eq ('Sedan' & 'Asia' and Origin 'Sedan' & 'Asia');
run;
The where condition is very obviously invalid syntax. Fix that in the data step code, and then start to make it dynamic by proper use of macro variables.
Agreeing with @Kurt_Bremser , you have to create working SAS code without macro variables first. If your code doesn't work properly without macro variables, then it will not work properly with macro variables.
Also, you rarely need to have the values of macro variables enclosed in quotes.
-- Paige Miller
Register Today!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.