I have several lists of ID numbers that are stored in macro variables. I have a macro that executes an SQL query and when I call the macro, I need to be able to specify which list to use. If I just put the macro variable in the macro call, I get an error that says more arguments have been passed than are specified. An example of what I have is below. %let list1 = 101,102,103,104,105; %let list2 = 106,107,108,109,110; %macro test(list); proc sql; connect to mysql(server); create table table1 as select * from connection to mysql ( select * from dataset where id in (&list)); disconnect from mysql; quit; %mend; %test(&list1); Hopefully this makes sense with what I am trying to do. Anyone have an idea of how this can work?
... View more