Depending on how you intend to use a "function like macro" you probably can't use any Proc or Data step inside the macro. Remember that what a macro does is generate SAS code. So when you attempt somethingl like:
data want;
set have;
value = %somemacro(a,b,c);
run;
If the "macro" calls proc sql then it attempts to resolve when compliling the data step to
data want;
set have;
value =
Proc sql;
select a
from b
where c;
quit;
or similar. So when the compiler sees the resolved Proc sql bit of code you get numerous errors about value = proc sql; is invalid syntax, select is incorrect (for a data step select) and quit is unrecognized.
... View more