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 are the ways to do a “table lookup” in sas?
explain the concepts and capabilities of business object? : Sas-bi
What is the role of unrestrictive users? : sas-grid-administration
How many data types are there in SAS?
What is the maximum and minimum length of macro variable
Why double trailing @@ is used in input statement?
This entry was posted in General. Bookmark the permalink. Post a comment or leave
What are the prime responsibilities of data integration administrator? : Sas-di
Do you need to rearrange the order of the data for the report?
Explain the main difference between the sas procedures and functions? : Sas-administrator
what is data integration? : Sas-di
What is run-group processing?
Difference between nodup and nodupkey options?
What is the basic structure of a sas program?
What is the basic syntax of a sas program?