SAS: Run SQL-query using a macro
问题 Using an answer from this thread, I was trying to get to work the following code. I have a list of sql-queries in a table plus an id for each query. Now I'd like to have the results of these queries plus the id as another table. /* The Macro */ %macro run_query(q,id); proc sql noprint; select count into: count from (&q.) a; quit; %mend; /* Some fake-data */ DATA queries; INPUT id :$12. query :$3000.; INFORMAT id $12.; INFILE DATALINES DSD; DATALINES; 01,SELECT COUNT(*) AS count FROM sashelp