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



If you need the value of a variable rather than the variable itself what would you use to load the..

Answer / yuyin

a=123;
call symput("x",a);
a is a variable, 123 is the value of variable a, x is macro
variable, symput will assign 123 to macro variable x.

Is This Answer Correct ?    12 Yes 0 No

If you need the value of a variable rather than the variable itself what would you use to load the..

Answer / saurabh gupta

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

Is This Answer Correct ?    0 Yes 2 No

If you need the value of a variable rather than the variable itself what would you use to load the..

Answer / yuyin

a is macro variable. use following statment to assign the
value of a rather than the variable itself
e.g.
%let a=xyz
x="&a";
this will assign "xyz" to x, not the variable xyz to x

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More SAS Interview Questions

If reading a variable length file with fixed input, how would you prevent SAS from reading the next record if the last variable didn?t have a value?

6 Answers  


You need to perform an analysis on a massive dataset by groups, but are unable to sort the data due to memory constraint. How would you accomplish the task?

2 Answers  


What is the maximum and minimum length of macro variable

0 Answers  


There is a field containing a date. It needs to be displayed in the format "ddmonyy" if it's before 1975, "dd mon ccyy" if it's after 1985, and as 'Disco Years' if it's between 1975 and 1985. How would you accomplish this in data step code? Using only PROC FORMAT

8 Answers   D&B,


Please write codes to merge two datasets and keep every record in the first dataset.

1 Answers  


The below code we are using for creating more than one macro variables in proc sql using into clause. How we can use same code to create macro variables vara, varb, varc instead of var1, var2, var3.? proc sql noprint; select count(distinct(patient)) into :var1 - :var3 from dataset1 group by trtreg1c ; quit;

1 Answers   Accenture,


What do the mod and int function do? : Sas programming

0 Answers  


What data sets do you need to produce the report?

2 Answers   Novartis,


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?

2 Answers  


what is broad cast agent? : Sas-bi

0 Answers  


What is your weekness? I am confuse what to say about this question. so can u give some answer which can be yur strenght.

1 Answers   Cipla,


What is the difference between Regression and Logistic Regression? Can u explain the Assumptions/Conditions?

3 Answers  


Categories