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

What is the basic structure of the SAS base program?

689


What is a pdv and what are its functions?

601


what versions of sas have you used (on which platforms)? : Sas programming

584


How do you debug and test your SAS programs?

1048


What was the last computer book you purchased? Why?

1915






What is data _null_?

699


describe the interaction table in sas di? : Sas-di

595


Where do you use proc means over proc freq?

564


How are numeric and character missing values represented internally?

1137


AE datasets names? how many types?

2078


How to sort in descending order?

794


What would you change about your job?

1926


explain the function of substr in sas? : Sas-administrator

556


how to remove duplicates using proc sql?

630


what is factor analysis? : Sas-administrator

613