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 categories that sas informats are used to the place the data? : Sas-administrator
What is program data vector (pdv)?
If you were told to create many records from one record, show how you would do this using array and with proc transpose?
Which function is used to count the number of intervals between two sas dates?
Can you execute macro within another macro? : sas-macro
what are validation tools that are used in sas? : Sas-administrator
how many display types available in sas bi dashboard? : Sas-bi
What is the role of sas grid administrator? : sas-grid-administration
Mention what is PROC in SAS?
how does sas handle missing values in formats? : Sas programming
What are the difference between ceil and floor functions in sas?
How to limit decimal places for the variable using proc means?
What’s the difference between var b1 – b3 and var b1 — b3?
Define run-group processing?
: and & modifiers.