How do you add a number to a macro variable?

Answer Posted / hsong001

Use %eval to do simple calculation for macro variables.
e.g.,
data _null_;
%let a = 1;
%let b = %eval(&a+1);
%put a=&a b=&b;
run;

Is This Answer Correct ?    9 Yes 0 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?

1442


How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?

1029


how to do user inputs and command line arguments in sas?

2676


if the Id has more then two transcatiion then show the first observation, IF Id has only two observation then It show both the observation

1382


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

2073


Explain the special input delimiters used in sas programming.

787


How to create a permanent sas data set?

872


What is the use of stop statement?

833


What are the automatic variables for macro? : sas-macro

870


what is the use of sas management console? : Sas-di

817


Differentiate between ceil and floor functions.

893


What is the general format of function in sas? : sas-grid-administration

776


What do you understand by the term Normal Distribution?

765


What is the difference between input and infile statement?

885


i have a dataset with 100 obs i want to generate title from 20th obs onwards with total observations. that should contain 100 obs.dont use firstobs and dnt split the data. use dataset block or proc report? how can we genarate;

2185