A macro function to produce a macro variable from a data variable
问题 data sample; input x $; datalines; one two three ; %macro variable_to_macvar(variable=, dataset=); proc sql noprint; select &variable into : outlist separated by ' ' from &dataset; quit; &outlist %mend variable_to_macvar; %put %variable_to_macvar(variable=x, dataset=sample); Expected output: one two three . Instead I get an error. Why? Is this fixable? I've successfully created other macros of a very similar form, where the function "returns" a value using the ¯ovariable at the end of the