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

how do we get duplicate observations in a separate dataset?

6 Answers   CitiGroup,


how will you location sas platform applications available from web browser? : Sas-bi

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 its between 1975 and 1985. How would you accomplish this in data step code? Using only PROC FORMAT.

3 Answers   CTS,


What type of tables you are using in YOUR reporting..???

2 Answers   GSK GlaxoSmithKline,


How would you remove a format that has been permanently associated with a variable? ________________

5 Answers   Quintiles, TCS,


Hi, I have one dataset, could you please ans for this. id amount paid_amount 1 700 400 2 900 250 3 300 300 a 400 250 b 500 320 c 800 650 x 200 190 y 900 250 z 300 180 i want create new dataset having id and paid_amount who are paid high amount comparing amount. ex: 1d paid_amount 3 300 c 650 x 190

3 Answers  


if i having variables named a b c d e f ,how to find total of each variable ????give syntax...??

6 Answers   Accenture,


what is proc Index? and what is proc document?

0 Answers   Mind Tree,


In proc transpose and data step with arrays which one you pick?

0 Answers   Accenture, Quintiles,


What is by-group processing?

0 Answers  


What techniques and/or PROCs do you use for tables?

4 Answers   Oracle,


why is sas considered self-documenting? : Sas programming

0 Answers  


Categories