How do you add a number to a macro variable?

Answers were Sorted based on User's Feedback



How do you add a number to a macro variable?..

Answer / hsong001

Use %eval to do simple calculation for macro variables.
e.g.,
data _null_;
%let a = 1;
%let b = %eval(&a+1);
%put a=&a b=&b;
run;

Is This Answer Correct ?    9 Yes 0 No

How do you add a number to a macro variable?..

Answer / ravi

%let=1;

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More SAS Interview Questions

In the SAS Data step what is the difference between the subsetting done by Where and subsetting done by If?

6 Answers   Cognizant,


how to handle in stream data containing semicolon in it?

3 Answers  


What are the special input delimiters used in SAS?

0 Answers  


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

0 Answers  


What do you feel about hardcoding?

3 Answers   Pfizer,






For what purpose would you use the RETAIN statement?

0 Answers   Quintiles,


you have a data set like this. data qqq; input name $ total; cards; qq 22 ww 33 qq 22 ee 44 rr 33 ww 44 ; run; and you want output like this......... name total qq 22 ww 44 Do it by data set step.

6 Answers  


is there any difference between proc summary and proc means?

3 Answers  


what is pdv? how it is related to input buffer in sas?

5 Answers   HSBC, Satyam,


AE datasets names? how many types?

0 Answers   Accenture,


what are sas/access and sas/connect? : Sas programming

0 Answers  


What is the difference between informat and format statement?

1 Answers  


Categories