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 are symget and symput? : sas-macro
Intern stastical programmer written test
How many data types are there in SAS?
Hi, Does anybody has lastest SAS certification(base, adv., clinical)dumps,if anybody has please email me at mailtorajani76@gmail.com. Thanks
How many ways to overcome a missing values???
why a stop statement is needed for the point= option on a set statement?
what is the difference between infile and input? : Sas-administrator
What makes sas stand out to be the best over other data analytics tools?
what are sas/access and sas/connect? : Sas programming
How can you create a macro variable with in data step? : sas-macro
what is snowflake schema? : Sas-di
How do you test for missing values?
explain the proc in sas? : Sas-administrator
what is the use of proc contents and proc print in sas? : Sas-administrator
What do the sas log messages “numeric values have been converted to character” mean? What are the implications?