How do you add a number to a macro variable?

Answer Posted / saurabh gupta

To add a number in macro use %EVAL macro

Example

%Let a= 2;
%Let b= 3;
%Let c= &a + &b ;
then it will give you value

c=2 + 3

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

%Let c= %eval(&a + &b)
Now this will give you the correct answer

c=5

Is This Answer Correct ?    15 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give e an example of..

1834


What are the advantages of using sas?

854


What are symget and symput? : sas-macro

980


What do the mod and int function do? : Sas programming

818


Explain what is SAS informats?

825


Explain what is data step?

926


How to create list output for cross-tabulations in proc freq?

845


what are some differences between proc summary and proc means? : Sas programming

748


what are all the reports you generated in your recent project?

1941


what is information maps?

1815


What do you know about sas data set?

803


what is PhaseIII, ODS, TLG, Macro and Proc in SAS

4127


What is SAS? What are the functions does it performs?

945


what is study design in while working with SAS? what are screening variables in SAS?

1907


How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, PROCs?

1309