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 &macrovar1; /*display*/

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are symget and symput? : sas-macro

1016


Intern stastical programmer written test

526


How many data types are there in SAS?

825


Hi, Does anybody has lastest SAS certification(base, adv., clinical)dumps,if anybody has please email me at mailtorajani76@gmail.com. Thanks

2031


How many ways to overcome a missing values???

2579


why a stop statement is needed for the point= option on a set statement?

841


what is the difference between infile and input? : Sas-administrator

879


What makes sas stand out to be the best over other data analytics tools?

826


what are sas/access and sas/connect? : Sas programming

785


How can you create a macro variable with in data step? : sas-macro

802


what is snowflake schema? : Sas-di

930


How do you test for missing values?

1330


explain the proc in sas? : Sas-administrator

863


what is the use of proc contents and proc print in sas? : Sas-administrator

851


What do the sas log messages “numeric values have been converted to character” mean? What are the implications?

979