Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How do you add a number to a macro variable?

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


Please Help Members By Posting Answers For Below Questions

What are the ways to do a “table lookup” in sas?

1032


explain the concepts and capabilities of business object? : Sas-bi

969


What is the role of unrestrictive users? : sas-grid-administration

1012


How many data types are there in SAS?

1082


What is the maximum and minimum length of macro variable

1261


Why double trailing @@ is used in input statement?

1229


This entry was posted in General. Bookmark the permalink. Post a comment or leave

4581


What are the prime responsibilities of data integration administrator? : Sas-di

1074


Do you need to rearrange the order of the data for the report?

2311


Explain the main difference between the sas procedures and functions? : Sas-administrator

1079


what is data integration? : Sas-di

1123


What is run-group processing?

1173


Difference between nodup and nodupkey options?

1200


What is the basic structure of a sas program?

1126


What is the basic syntax of a sas program?

1219