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 ¯ovar1; /*display*/
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the basic structure of the SAS base program?
What is a pdv and what are its functions?
what versions of sas have you used (on which platforms)? : Sas programming
How do you debug and test your SAS programs?
What was the last computer book you purchased? Why?
What is data _null_?
describe the interaction table in sas di? : Sas-di
Where do you use proc means over proc freq?
How are numeric and character missing values represented internally?
AE datasets names? how many types?
How to sort in descending order?
What would you change about your job?
explain the function of substr in sas? : Sas-administrator
how to remove duplicates using proc sql?
what is factor analysis? : Sas-administrator