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

Explain the special input delimiters used in sas programming.

781


Explain proc sort?

871


Give some examples where proc report’s defaults are same as proc print’s defaults?

887


What is the function of output statement in a SAS Program?

813


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

777


what is sas data set?

865


what is the basic structure sas administrator? : Sas-administrator

788


what is the primary data source for the wrs? : Sas-bi

879


What is the use of PROC gplot?

868


What is the difference between %put and symbolgen? : sas-macro

920


What is a method to debug and test your SAS program?

984


Mention some common errors that are usually committed in sas programming.

808


What are the uses of sas?

912


describe how to adjust the performance of data integrator? : Sas-di

763


What are the new features included in the new version of SAS Programming Language?

956