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 |
sas implementing companies in pune implementing clinical projects if anyone knows plz send ans immediately
How does Mr.Lanka Srinivas teach SAS? Are his accomplishments real? What are the future prospects for SAS?
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?
What are the joins,types of joins and thier functions?
What are _numeric_ and _character_ and what do they do?
Mention what is PROC in SAS?
Compare sas with other data analytics tools.
What are the ways to do a “table lookup” in sas?
How can I remove header from output data set?
What is the work of tranwrd function?
WHAT IS DEBUGGING? HOW TO TEST THE DEBUGGING IN SAS?
What do you code to create a macro? : sas-macro