Interview Questions   Tutorials   Discussions   Programs   Videos   

SAS - How do you add a number to a macro variable?




347
views
asked mar September 20, 2014 06:29 AM  

How do you add a number to a macro variable?


           

1 Answers



 
answered By vishnoiprem   0  

To add a number in macro use %EVAL macro

E.g.

%Let A= 2;
%Let B= 3;
%Let total= &A + &B ;
then it will give you value

total=2 + 3

but If you will use %eval it will give you sum

%Let total= %eval(&A + &B)

Now this will give you the correct answer

total=5 
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert