ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Data Warehouse  >>  SAS
 
 


 

 
 Teradata interview questions  Teradata Interview Questions
 Business Objects interview questions  Business Objects Interview Questions
 Cognos interview questions  Cognos Interview Questions
 Informatica interview questions  Informatica Interview Questions
 Crystal Enterprise Suite interview questions  Crystal Enterprise Suite Interview Questions
 Actuate interview questions  Actuate Interview Questions
 Ab Initio interview questions  Ab Initio Interview Questions
 Data Stage interview questions  Data Stage Interview Questions
 SAS interview questions  SAS Interview Questions
 Micro Strategy interview questions  Micro Strategy Interview Questions
 ETL interview questions  ETL Interview Questions
 Data Warehouse General interview questions  Data Warehouse General Interview Questions
Question
How do you add a number to a macro variable?
 Question Submitted By :: Nikosh04
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How do you add a number to a macro variable?
Answer
# 1
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 ?    1 Yes 0 No
Saurabh Gupta
 
  Re: How do you add a number to a macro variable?
Answer
# 2
%macro add(a,b);
%if (%datatyp(&a)=NUMERIC and %datatyp(&b)=NUMERIC) %then %
do;
    %put The result is %sysevalf(&a+&b).;
%end;
%else %do;
   %put Error:  Addition requires numbers.;
%end;
%mend add;

You can invoke the ADD macro as: 

%add(5.1E2,225)
 
Is This Answer Correct ?    1 Yes 0 No
Nani
 
 
 

 
 
 
Other SAS Interview Questions
 
  Question Asked @ Answers
 
What do you feel about hardcoding? Oracle4
Does SAS ?Translate? (compile) or does it ?Interpret?? Explain.  6
Name and describe three SAS functions that you have used, if any?  2
Briefly describe 5 ways to do a "table lookup" in sas.  2
WHAT IS LAG FUNCTION ? WHERE CAN YOU IMPLEMENT THIS FUNCTION? Zensar2
At compile time when a SAS data set is read, what items are created?  3
How the date 04oct1994 is stored in SAS,not only give the answer explain in brief?  3
If you have a data set that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variable?  14
what is Enterprise Guide?what is the use of it? CitiGroup2
What is the significance of the ‘OF’ in X=SUM (OF a1-a4, a6, a9);?  5
Name statements that function at both compile and execution time. L&T1
what is sas? is a package or tool? give me introduction about sas?  9
How would you include common or reuse code to be processed along with your statements? Accenture3
At compile time when a SAS data set is read, what items are created? Accenture8
how do u validate sas program Accenture1
The Lion King is hosting an animal conference. All the animals in the world attend except one. Which animal does not attend? Oracle3
what is the diff b/w verification validation in sas SAS3
Can you use a macro within another macro? If so how would SAS know where the current acro ended and the new one began?  2
what is Global Symbol table and Local symbol table? CitiGroup2
is there any differnce between proc means and proc summary?  2
 
For more SAS Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com