
Rick A. answered 04/03/19
Experienced SAS Professional
Here is the program and the results (I added 6 and 7 ampersands as additional examples):
%let test = one;
%let one = two;
%let two = three;
%macro raa;
%put oneamp=&test;
%put twoamp=&&test;
%put threeamp=&&&test;
%put fouramp=&&&&test;
%put fiveamp=&&&&&test;
%put sixamp=&&&&&&test;
%put sevenamp=&&&&&&&test;
%mend;
%raa
==============================================
oneamp=one
twoamp=one
threeamp=two
fouramp=one
fiveamp=two
sixamp=two
sevenamp=three
==============================================
An explanation for what is going on here is beyond the scope of this facility. I'd recommended reviewing the following public document from SUGI 29:
https://support.sas.com/resources/papers/proceedings/proceedings/sugi29/063-29.pdf