I would like to include the results of a macro function call in a data step. I can do this indirectly, by first assigning the macro function output to a macro variable, and then using that macro variable within my function, but this seems inelegant.
data dataset_employee;
input name $ dept $;
datalines;
John Sales
Mary Acctng
;
data dataset_employee;
input name $ dept $;
datalines;
John Sales
Mary Acctng
;
data dataset_manager;
input name $ dept $;
datalines;
Will Sales
Sue Acctng
;
It seems like SAS doesn't realize that the macro call is complete and I'm switching to regular SAS code.
/*this works*/
%let var = %DO_OVER(VALUES=employee, PHRASE=dataset_?) dataset_manager;
data combined1;
set &var dataset_manager;
run;
/*this fails*/
data combined;
set %DO_OVER(VALUES=employee manager, PHRASE=dataset_?);
dataset_manager;
run;
/*this works*/
data combined;
set dataset_manager %DO_OVER(VALUES=employee manager, PHRASE=dataset_?);
;
run;
Can anyone help me understand what is going on here?