%macro carmake(Make= , Models=);
where Make in (&make)and Model in (&models);
%carmake(Make= "Acura" "Audi" "BMW" "Hyundai", Models= "SUV" "Sedan");
Part of the problem is that you did not follow the general recommended advice, to first create code that works properly without macro variables and without macros. Had you done that, perhaps you would have figured out the problem, and then your macro would work properly.
But without macro variables and without macros, your code is this
data cars; set sashelp.cars; where Make in ( "Acura" "Audi" "BMW" "Hyundai") and Model in ("SUV" "Sedan"); run;
which doesn't work the way you want either. It returns an empty data set.
So please follow the above very good advice. You need to first make this code work without macros and without macro variables, and then you should be able to make your macro work properly.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.
Find more tutorials on the SAS Users YouTube channel.