Title: why does %superq(&bob) display variable when &bob dosn't in an %marco?
Tags: sas
Question: i have a macro like:
%macro processme(uuid=);
%put &amp;uuid;
%mend;
called from another macro where uuid is generated:
%macro processLinks (data=);
proc sql;
reset noprint;
select uuid into :uuid1 from &amp;data;
%local i;
%do i = 1 %to &amp;sqlobs;
%processLink (uuid=uuid&amp;i);
%mend;
and this macro is called from invoked as:
%processLinks(data=x.entities)
x.entities contains eight or so uuid in the form of 12345-123123-1234123-2342 etc
when this is run it just prints uuid1 through the uuid8 from the put command
if i change the put command to:
%put %superq(&amp;uuid)
it then prints all uuid as expected ie 12345-123123-1234123-2342
question is why do i need to superq this to get my expected result or am i just plain doing something wrong ( again :) )
Thanks

Here is the accepted answer: In procesLink macro variable uuid contains uuid1 and not actually the uuid itself than uuid1 is given to superq which than resolvs to the actual uuid. You could also use &amp;&amp;&amp; instead of superq
example
%macro m(b);
%put &amp;b;
%put %superq(&amp;b);
%put &amp;&amp;&amp;b;
%mend;
%let a=5;
%m(b=a)
output
but more correct would be to call %m(b=&amp;a)


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2019:00:04/26/19', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<sas>', 'Title': "why does %superq(&bob) display variable when &bob dosn't in an %marco?", 'ViewCount': 23, 'id': 55864377, 'user_AboutMe': '', 'user_AccountId': 5960181.0, 'user_DisplayName': 'Dwayne Dibbley', 'user_Reputation': 451.0, 'user_Views': 87.0, 'user_id': 4685589.0}}