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 IS SAS WEB SERVICE and what are the steps to create an xml service ?

2799


what is sas database server? : Sas-di

1133


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

1947


How to convert a numeric variable to a character variable?

1209


what is the difference between nodup and nodupkey options? : Sas programming

1192


What was the last computer book you purchased? Why?

2374


Mention sas system options to debug sas macros.

1177


What are the best sas programming practices for handling very large datasets? : sas-grid-administration

1016


how are numeric and character missing values represented internally? : Sas programming

1146


What is the different between functions and PROCs that calculate the same simple descriptive statistics?

1791


In SAS explain which statement does not perform automatic conversions in comparisons?

1312


What is Linear Regression?

1165


Mention few capabilities of sas framework.

1182


Tell me about % include and % eval? : sas-macro

1144


Describe a time when you were really stuck on a problem and how you solved it?

2637