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
explain about various caches available in data integrator? : Sas-di
How would you determine the number of missing or nonmissing values in computations?
what are some good sas programming practices for processing very large data sets? : Sas programming
what are the scrubbing procedures in sas? : Sas programming
explain what is data set in sas? : Sas-administrator
What can you learn from the SAS log when debugging?
How do you specify the number of iterations and specific condition within a single do loop?
Did you used proc test? when?
what techniques and/or procs do you use for tables? : Sas programming
How to include or exclude specific variables in a data set?
Differentiate between format and informat? : sas-grid-administration
what is enterprise guide? What is the use of it? : Sas programming
What is the maximum and minimum length of macro variable
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
explain the difference between proc means and proc summary?