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 |
How to get the repeated values by using sql in sas ?
why a stop statement is needed for the point= option on a set statement?
how do you test for missing values? : Sas programming
what is the prob plot in clinical domain
Explain the message 'Merge has one or more datasets with repeats of by variables'.
What is the order of evaluation of the comparison operators: + - * /** ()?
How to select the observations randomly from a SAS dataset
I am having a stored process.it needs to route my report to both hthml and Xls.By default SP routes to html.I used the PRINTTO to route the html to Xls.BUt it createsthe file not but no content was written to file(0KB)?how can i do it?
Which is the Best SAS training Institute in Delhi NCR for SAS certification preparation
Of all your work, where have you been the most successful?
What’s the difference between var b1 – b3 and var b1 — b3?
What is the role of administrative users? : sas-grid-administration