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 |
What would the following datastep do? Data _null_; Set Dist end=eof; Call Symput("xx"!!left(put(_n_,2.)),&dimension); If EOF then Call Symput('numrows',left(put(_n_,2.))); Run; dimension is a macro variable that is being passed here
explain the main difference between the nodup and nodupkey options? : Sas-administrator
what is the frontend and backend of sas? Is sas is a progaming langauge or tool? on which langauge sas depends?
Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro
. Which date advances a date, time or date/time value by a given interval?
Which function is used to count the number of intervals between two sas dates?
which stats created by proc means that are not created by proc summary or vice versa?
Are you familiar with special input delimiters? How are they used?
Explain the special input delimiters used in sas programming.
how can you improve the performance of a query, If it is excuting very slowly?
What is the purpose of _character_ and _numeric_?
i want for interview question & answer plz it need immediate send t my mail raviprakashmot@gmal.cm