Tag: macros

Jim Simon 6
SAS 9.3 macro SQL trick

Suppose you need to create a numbered series of macro variables, one macro variable per row, from an SQL query. Suppose you magically know in advance that a given WHERE clause returns, say, 123 rows.  No problem! proc sql; select customer_name into :name1-:name123 from orion.customer where country='DE'; quit; Now suppose you