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

how do you test for missing values? : Sas programming

673


what do the sas log messages "numeric values have been converted to character" mean? What are the implications? : Sas programming

786


what techniques and/or procs do you use for tables? : Sas programming

666


What are the table names in oracle database...?

2373


How would you define the end of a macro? : sas-macro

717






what is change analysis in sas di ? : Sas-di

686


what is sas enterprise intelligence architecture? : Sas-bi

639


name the scheduler for scheduling job and explain the scheduler? : Sas-di

723


What is the use of divide function?

690


What are the new features included in the new version of SAS Programming Language?

831


what is operational data and operational system? : Sas-di

735


If you could design your ideal job, what would it look like?

2479


What are the automatic variables for macro? : sas-macro

765


What is the length assigned to the target variable by the scan function?

772


What is the role of unrestrictive users? : sas-grid-administration

659