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

How to create an external dataset with sas code?

0 Answers  


what is null hypothesis? why do you consider that?

0 Answers   Accenture, Quintiles,


There is a river notoriously known for it?s large crocodile population. With ease, how do you safely cross it?

1 Answers   Oracle,


libname deepak 'C:\SAS Files'; proc format; invalue convert 'A+' = 100 'A' = 96 'A-' = 92 'B+' = 88 'B' = 84 'B-' = 80 'C+' = 76 'C' = 72 'F' = 65; data deepak.grades; input ID $3. Grade convert.; *format Grade convert. ; datalines; 001 A- 002 B+ 003 F 004 C+ 005 A ; proc print data = deepak.grades; run; I get the following output Obs ID Grade 1 001 . 2 002 . 3 003 . 4 004 . 5 005 . I don’t understand why Grade shows up as a missing value. Everything seems fine, including ID $3. Now, in case I use ID : $3. Or use column input, I get the desired output. Kindly help Deepak

7 Answers  


What is the basic syntax style in SAS?

0 Answers  






what is the use of LRECL option.

1 Answers   L&T,


If you set a label in the data step and call a proc freq on the data, how do you display the data without the labels and just the variables.

1 Answers  


what is the difference between DUPKEY and NODUPKEY???

4 Answers   Cognizant, EXL,


What are the difference between sas functions and procedures?

0 Answers  


What is a macro routine?

0 Answers  


I have 50 variables in one data set, In reports i want to generate every 10 variables in one page how we will write code in proc report.

4 Answers  


What are the Aggregate functions in SQL ?

2 Answers   AON,


Categories