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 the special input delimiters used in sas programming.
Explain proc sort?
Give some examples where proc report’s defaults are same as proc print’s defaults?
What is the function of output statement in a SAS Program?
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
what is sas data set?
what is the basic structure sas administrator? : Sas-administrator
what is the primary data source for the wrs? : Sas-bi
What is the use of PROC gplot?
What is the difference between %put and symbolgen? : sas-macro
What is a method to debug and test your SAS program?
Mention some common errors that are usually committed in sas programming.
What are the uses of sas?
describe how to adjust the performance of data integrator? : Sas-di
What are the new features included in the new version of SAS Programming Language?