Hi all in the Community! I want to create a macro with a SQL statement in it. The variables must be one of the macro's parameters. The macro is as follows: %macro sqlstep(vars=); proc sql; select <insert variables here> from work.class; quit; %mend; Suppose I want to select 2 variables: name and gender. A way to select them is to write the macro as follows: %macro sqlstep(vars=); proc sql; select &vars from work.class; quit; %mend; And I select them when invoking the macro: %sqlstep(vars=name %str(,) gender). But this is a time consuming way, and probably inefficient (imagine I have 50 variables instead of 2). Do you know any way to put the comma inside the macro, instead of the invocation? I want to invoke it like this: %sqlstep(vars=name gender) That's all. I hope that I didn't write a novel!
... View more