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

How do you control the number of observations and/or variables read or written? Approximately what date is represented by the SAS date value of 730?

1728


Explain proc univariate?

1106


Approximately what date is represented by the SAS date value of 730?

1270


Mention the validation tools used in SAS?

1230


How necessary is it to be creative in your work?

2526


Describe what are the different levels of administrative users in sas? : sas-grid-administration

1082


what is sas application server? : Sas-di

1136


what is the limit of the number of the rows and columns available in the worksheet? : Sas-bi

1139


What is the difference between proportion and average?

3405


explain what is factor analysis? : Sas-administrator

1173


Name and describe few sas character functions that are used for data cleaning in brief.

1182


For what purposes have you used sas macros? : sas-macro

1050


If a variable contains letters or special characters, can it be numeric data type?

1282


What is the difference between %put and symbolgen? : sas-macro

1300


what techniques and/or procs do you use for tables? : Sas programming

1102