If you need the value of a variable rather than the
variable itself what would you use to load the value to a
macro variable?

Answer Posted / damwal

Use CALL SYMPUT routine.
Below I show how to assign the value of 3rd observation of
variable name (94) to a macro variable named "macrovar1"

data test;
input name @@;
datalines;
1 21 94 444 5
;

data _null_;
set test (firstobs=3 obs=3);
call symput("macrovar1",name);
run;

%put &macrovar1; /*display*/

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

explain about various caches available in data integrator? : Sas-di

590


How would you determine the number of missing or nonmissing values in computations?

658


what are some good sas programming practices for processing very large data sets? : Sas programming

518


what are the scrubbing procedures in sas? : Sas programming

842


explain what is data set in sas? : Sas-administrator

533






What can you learn from the SAS log when debugging?

925


How do you specify the number of iterations and specific condition within a single do loop?

630


Did you used proc test? when?

1591


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

584


How to include or exclude specific variables in a data set?

653


Differentiate between format and informat? : sas-grid-administration

589


what is enterprise guide? What is the use of it? : Sas programming

546


What is the maximum and minimum length of macro variable

661


What is auto call macro and how to create a auto call macro? What is the use of it? How to use it in sas with macros? : sas-macro

585


explain the difference between proc means and proc summary?

680