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 categories that sas informats are used to the place the data? : Sas-administrator

987


What is program data vector (pdv)?

1184


If you were told to create many records from one record, show how you would do this using array and with proc transpose?

1412


Which function is used to count the number of intervals between two sas dates?

1063


Can you execute macro within another macro? : sas-macro

933


what are validation tools that are used in sas? : Sas-administrator

1000


how many display types available in sas bi dashboard? : Sas-bi

1029


What is the role of sas grid administrator? : sas-grid-administration

1229


Mention what is PROC in SAS?

1005


how does sas handle missing values in formats? : Sas programming

1075


What are the difference between ceil and floor functions in sas?

1274


How to limit decimal places for the variable using proc means?

995


What’s the difference between var b1 – b3 and var b1 — b3?

1275


Define run-group processing?

977


: and & modifiers.

1332