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?
Answers were Sorted based on User's Feedback
Answer / chaitanya
If we need a value of a macro variable then we must define
it in such terms so that we can call them everywhere in the
program. Define it as Global. There are different ways of
assigning a global variable. Simplest method is %LET.
Ex: A, is macro variable. Use following statement to assign
the value of a rather than the variable itselfe.g.
%Let A=xyz x="&A";
This will assign "xyz" to x, not the variable xyz to x.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / 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 |
Difference Between Scan and Substr
In sas admin differentiate between roles and capabilities? : sas-grid-administration
The Lion King is hosting an animal conference. All the animals in the world attend except one. Which animal does not attend?
how can you sort the dataset having millions of OBS(instead of sort procedure?
"What is the difference between proc sort nodup and proc sort nodupkey?"
What is program data vector (pdv) and what are its functions?
How to get any kind of data in SAS? Is it possible to take data from notepad in SAS?
Does anybody has SAS Platform Administration certification dumps. pls send to hariithepalli@gmail.com
How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data set to a second data set, and the non-matches of the right-most data set to a third data set?
Can we replace a dataset into view?
what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming
How can you put a "trace" in your program?