We know that macro variables are stored as character values. The %eval function helps evaluate integers or logical expressions. The function converts the character data to a numeric or logical expression. After performing the evaluation, it then converts the result back to a character value and returns the value.
We will now try and evaluate some macro variables:
OPTIONS SYMBOLGEN;
%Let A1 = (1+0);
%Let A2 = (1+5);
%Let A3 = (10-5);
%Let A4 = (10/5);
%Let A5 = (10/3);
%Let A6 = (1-0.1);
%Let eval_A1 = %eval(&A1);
%Let eval_A2 = %eval(&A2);
%Let eval_A3 = %eval(&A3);
%Let eval_A4 = %eval(&A4);
%Let eval_A5 = %eval(&A5);
%Let eval_A6 = %eval(&A6);
%PUT eval_A1 = &eval_A1;
%PUT eval_A2 = &eval_A2;
%PUT eval_A3 = &eval_A3;
%PUT eval_A4 = &eval_A4;
%PUT eval_A5 = &eval_A5;
%PUT eval_A6 = &eval_A6;
In the following LOG, we get the resolution...