Where were you when I needed you? Just how long have you kept that naughty
question bottled up where it cannot see the light of day? How many others
harbor that naughty question? Well, all of you got some answers today.
Some technically perfect regurgitations of the SAS documentation without a
care about consequences which those who don't like to read for themselves
will find somewhat useful. Some sagely suggesting that some newer SAS
Constructs might be worth investigating, and, indeed, there may be something
worth examining about your approach to solving problems when you think your
design _requires_ 4 ampersands. And some even suggested that there might be
some among us who would argue for SCL. Good question, indeed! There must
be more related questions about concatenated ampersands. The Whitehurst
first principle of SAS program design states: Never burden any of your SAS
creations with any concatenated ampersands. If someone can show me a single
instance where concatenated ampersands are required because there is no
alternative way to solve the problem, I will revise my first principle of
Now back to my vacation.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Talbot
Sent: Thursday, June 09, 2005 1:39 PM
It requires SIX ampersands to resolve the macro variable example below:
data _null_ ;
set DS1 end = last ;
call symput("mlv" || compress(put(_N_,best32.)), mli)
call symput(mli, tdt) ;
if last then do ;
call symput("mlin", compress(put(_N_,best32.))) ;
%put &&mlv&mlin. = &&&&&&mlv&mlin. ;
(So, if there are five observations in the data set, and the fifth value of
mli is "DAISY" and the fifth value of tdt is "YELLOW" this will print
out "DAISY = YELLOW")
Why does it take so many ampersands to resolve? Can someone please explain
this resolution to me so that it gets through my extremely dense skull?
-- TMK --
"The Macro Klutz"