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 do you know about sas and what we do? : sas-grid-administration
how to debug and test the sas program? : Sas-administrator
what are some problems you might encounter in processing missing values? In data steps? Arithmetic? Comparisons? Functions? Classifying data? : Sas programming
i want for interview question & answer plz it need immediate send t my mail raviprakashmot@gmal.cm
What is PROC in SAS?
Name validation tools used in SAS
What do the put and input function do?
how would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable? : Sas programming
Can you execute macro within another macro? : sas-macro
I have a dataset concat having a variable a b & c. How to rename a b to e & f?
Mention common programming errors committed in sas ?
Mention what is SAS data set?
Why and when do you use proc sql?
I have 3 years of work experience at a startup and recently got certified in Data Science with SAS. I need to know how to get into the analytics industry
What would be the result of the following SAS function (given that 31 Dec, 2000 is Sunday)?