What is the difference Using & and && in the macro variables

Answers were Sorted based on User's Feedback



What is the difference Using & and && in the macro variables..

Answer / naga

& is used to resolve the direct macro reference.
&& is used to resolve the indirect macro reference.
for example let us assume we need to resolve city1 to banglore
%let &city&n /*incorrect*/
%let &&city&n /*correct*/

Is This Answer Correct ?    20 Yes 1 No

What is the difference Using & and && in the macro variables..

Answer / subbu

%let a=sai;
%let b=kumar;


%let c=&a.&b;

%put &c;

Is This Answer Correct ?    4 Yes 4 No

What is the difference Using & and && in the macro variables..

Answer / smriti

& represents that it is a macro variable and && is used to
replace the macro variable with the value of the variable.

Is This Answer Correct ?    7 Yes 8 No

What is the difference Using & and && in the macro variables..

Answer / alla

when concatinating two macro variable
%let a=sai;
%let b=kumar;
%let &a &b;it resolves as sai kumar
if u want to remove the space b/t then use
%let &&a&b; it resolves as saikumar
when you use %let &a&b;resolves as &akumar

Is This Answer Correct ?    2 Yes 6 No

What is the difference Using & and && in the macro variables..

Answer / srk

there is nothing difference b/w & and && for resolving
macros both are same..these are two types of syntax for
resolving macro variable.

Is This Answer Correct ?    1 Yes 12 No

Post New Answer

More SAS Interview Questions

Approximately what date is represented by SAS date value of 730

9 Answers  


what techniques and/or procs do you use for tables? : Sas programming

0 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,


how do you derive descriptive statistics?

1 Answers   Accenture, Quintiles,


how do u identify a macro variable

5 Answers  






what is the difference btw proc means and proc univariate?

8 Answers   HSBC, TCS,


What are _numeric_ and _character_ and what do they do?

1 Answers   Quintiles,


Difference between informat and format?

0 Answers  


What is the difference between class statement and by statement in proc means?

0 Answers  


What is the purpose of using the N=PS option?

2 Answers   Oracle,


if a variable contain dates like "2015/01"---"2015/12" (yymm) ,How to add day to those dates,if them month is jan then 31 if the month is feb then 28 so on ...

0 Answers   Accenture,


what has been your most common programming mistake? : Sas programming

0 Answers  


Categories