@SASPhile wrote:
two columns colA and Colb are present in dataset have and both are numeric. When I use the following I'm getting Error "A Character operand was found in %eval function.
%let var1=%eval((colA+colB)*colB));
data test;
set have;
va1=&var1.;
run;
Once again, catastrophic misunderstanding of macro timing. Lots of insights into the force of macro to gain you need, young padawan, before use it you can without harm.
The macro PREprocessor sees only text. The text (colA+colB)*colB is nothing numeric that can be evaluated, so the %eval (as it happens immediately in the %let) will fail. I also fail to see the wisdom of packing data step logic into a macro variable. This will only reduce the maintainability of your code.
... View more