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 is SAS?
Explain proc sort?
Is the physical structure of the data set in the same orientation as the report? Do you need to reshape the data sets? What method should you use to reshape the data–DATA steps,PROC TRANSPOSE,output data set from a procedure?
I need level 2 to 5 sas using companies in india
what are all the reports you generated in your recent project?
This entry was posted in General. Bookmark the permalink. Post a comment or leave
Give some examples where proc report’s defaults are different than proc print’s defaults?
List out some key concept of SAS
What are the difference between sas functions and procedures?
Tell me about % include and % eval? : sas-macro
What does the trace option do?
Describe the ways in which you can create macro variables? : sas-macro
How to limit decimal places for variable using proc means?
how to remove duplicates using proc sql?
What is the order of application for output data set options, input data set options and SAS statements?