What is the difference Using & and && in the macro variables
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?
In SAS how to read the variable values having different formats. eg:mar99,mar1999 (in a single variable)
8 Answers GSK GlaxoSmithKline,
how to write code for left outer join in SAs using datastep?
how to shift the rows to cols? eg: i have like field1 field2 field3 10 20 20 this should be displayed as field1 10 field2 20 field3 30 (without the obs col) how do this?can i use transpose or tell me suitable way to do this?
describe about metadata object? : Sas-di
in the flow of data step processing, what is the first action in a typical data step? : Sas programming
What is maximum number of rows and cols can be handled in SAS?
what is data governance? : Sas-di
How to merge the data using merge statement and proc format? Is the result is same ?
If you’re not wanting any SAS output from a data step, how would you code the data statement to prevent SAS from producing a set?
Name and describe three SAS functions that you have used, if any?
if you were told to create many records from one record, show how you would do this using array and with proc transpose? : Sas programming