Answer Posted / nani
%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 | 1 No |
Post New Answer View All Answers
WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?
what is sas database server? : Sas-di
Hello Friends, am new to this forum and am not good at sas progarmming. please can any one of you send me couple of sample large sample SAS Jobs which can you use 200 MB of data and other sas job upto 25GB of data. am doing a performance testing on our legacy systems and new upgraded system. I would really appreciate if you can do me this favor Thank you Priya
How to convert a numeric variable to a character variable?
what is the difference between nodup and nodupkey options? : Sas programming
What was the last computer book you purchased? Why?
Mention sas system options to debug sas macros.
What are the best sas programming practices for handling very large datasets? : sas-grid-administration
how are numeric and character missing values represented internally? : Sas programming
What is the different between functions and PROCs that calculate the same simple descriptive statistics?
In SAS explain which statement does not perform automatic conversions in comparisons?
What is Linear Regression?
Mention few capabilities of sas framework.
Tell me about % include and % eval? : sas-macro
Describe a time when you were really stuck on a problem and how you solved it?