Monday, July 5, 2010

Quick tip: %EVAL

Essentially, the value of all macro variables is character string.

Sometimes, we do need that macro variable has only numeric value.
We can use %EVAL to judge if the string is numeric value.


* Sample;
%let mv=1+a;

%let a=%eval(%scan(&mv, 1, +));
%let b=%eval(%scan(&mv, 2, +)); * Error occurs;

No comments: