<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Weird Macro resolving issue. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Weird-Macro-resolving-issue/m-p/401600#M97472</link>
    <description>&lt;P&gt;you have to use comma to between different variables in SELECT and GROUP BY statements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;select count(distinct usubjid) as count, &lt;U&gt;&amp;amp;&lt;/U&gt;&lt;/FONT&gt;&lt;U&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;byvar.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;var.&lt;/FONT&gt;&lt;/U&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;U&gt; ord2&lt;/U&gt;, txt2, ord3, txt3, ord4, txt4 &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;from frq01_01&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;group by &lt;U&gt;&amp;amp;&lt;/U&gt;&lt;/FONT&gt;&lt;U&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;byvar.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;var.&lt;/FONT&gt;&lt;/U&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;U&gt; ord2&lt;/U&gt;, txt2, ord3, txt3, ord4, txt4;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;So put comma between &amp;amp;&lt;FONT color="#008080" face="Courier New" size="3"&gt;byvar.&lt;/FONT&gt; , &amp;amp;&lt;FONT color="#008080" face="Courier New" size="3"&gt;var.&lt;/FONT&gt; , ord2 and if everything else is ok, your code should run&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Oct 2017 04:03:59 GMT</pubDate>
    <dc:creator>ali_jooan</dc:creator>
    <dc:date>2017-10-06T04:03:59Z</dc:date>
    <item>
      <title>Weird Macro resolving issue.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weird-Macro-resolving-issue/m-p/401018#M97234</link>
      <description>&lt;P&gt;Hi, I am getting&amp;nbsp;an error while passing the below code (Excerpts only). I have also shared the log (Below the&amp;nbsp; code).&lt;/P&gt;&lt;P&gt;ALL of the below code is in a Macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;create table frq02_01 as select count(distinct usubjid) as count, &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;byvar.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;var.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ord2, txt2, ord3, txt3, ord4, txt4 &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;from frq01_01&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;group by &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;byvar.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;var.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ord2, txt2, ord3, txt3, ord4, txt4;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;create table frq02_02 as select count(distinct usubjid) as count, &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;byvar.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;var.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ord2, txt2, ord3, txt3, ord4, txt4, atoxgr &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;from frq01_01&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;group by &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;byvar.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;var.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ord2, txt2, ord3, txt3, ord4, txt4, atoxgr;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;create table frq02_03 as select count(distinct usubjid) as count, &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;byvar.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;var.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ord2, txt2, ord4, txt4 &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;from frq01_01&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;group by &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;byvar.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;var.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ord2, txt2, ord4, txt4;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;create table frq02_04 as select count(distinct usubjid) as count, &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;byvar.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;var.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ord2, txt2, ord4, txt4, atoxgr &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;from frq01_01&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;group by &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;byvar.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;var.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ord2, txt2, ord4, txt4, atoxgr;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Macro call:&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;STRONG&gt;&lt;I&gt;outputs&lt;/I&gt;&lt;/STRONG&gt;(mpop=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%str&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(upcase(isft3fl) = "Y"),pop=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%str&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(upcase(parcat1) = "HEMATOLOGY"),&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;byvar=regionn, &lt;FONT color="#ff9900"&gt;var=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#ff9900" face="Courier New" size="3"&gt;%str&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT color="#ff9900"&gt;(,)&lt;/FONT&gt; ,output_name=h);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**********************************************LOG (Excerpts only) *********************************************;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MPRINT(OUTPUTS): proc sql noprint;&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the invoked macro "OUTPUTS".&lt;/P&gt;&lt;P&gt;19646 ord2, txt2, ord3, txt3, ord4, txt4 from frq01_01 group by &amp;amp;byvar. &amp;amp;var. ord2, txt2, ord3, txt3, ord4, txt4;&lt;/P&gt;&lt;P&gt;____ ____&lt;/P&gt;&lt;P&gt;&amp;#12; The SAS System&lt;/P&gt;&lt;P&gt;22 201&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993366"&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, *, **, +, ',', -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?, AND, AS, CONTAINS, EQ, EQT, FROM, GE,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993366"&gt;GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993366"&gt;ERROR 201-322: The option is not recognized and will be ignored.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;19646 ! ord2, txt2, ord3, txt3, ord4, txt4 from frq01_01 group by &amp;amp;byvar. &amp;amp;var. ord2, txt2, ord3, txt3, ord4, txt4;&lt;/P&gt;&lt;P&gt;____&lt;/P&gt;&lt;P&gt;22&lt;/P&gt;&lt;P&gt;MPRINT(OUTPUTS): create table frq02_01 as select count(distinct usubjid) as count,&lt;FONT color="#0000ff"&gt; regionn ,.&lt;/FONT&gt; ord2, txt2 , ord3, txt3, ord4, txt4 from frq01_01 group&lt;/P&gt;&lt;P&gt;by regionn , ord2, txt2, ord3, txt3, ord4, txt4;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993366"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, ;, (, ',', '.', ANSIMISS, AS, CROSS, EXCEPT, FULL, GROUP, HAVING, INNER, INTERSECT,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993366"&gt;JOIN, LEFT, NATURAL, NOMISS, ORDER, OUTER, RIGHT, UNION, WHERE.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;/P&gt;&lt;P&gt;MPRINT(OUTPUTS): create table frq02_02 as select count(distinct usubjid) as count, regionn , ord2, txt2, ord3, txt3, ord4, txt4, atoxgr from frq01_01&lt;/P&gt;&lt;P&gt;group by regionn , ord2, txt2, ord3, txt3, ord4, txt4, atoxgr;&lt;/P&gt;&lt;P&gt;NOTE: Statement not executed due to NOEXEC option.&lt;/P&gt;&lt;P&gt;MPRINT(OUTPUTS): create table frq02_03 as select count(distinct usubjid) as count, regionn , ord2, txt2, ord4, txt4 from frq01_01 group by regionn ,&lt;/P&gt;&lt;P&gt;ord2, txt2, ord4, txt4;&lt;/P&gt;&lt;P&gt;NOTE: Statement not executed due to NOEXEC option.&lt;/P&gt;&lt;P&gt;MPRINT(OUTPUTS): create table frq02_04 as select count(distinct usubjid) as count, regionn , ord2, txt2, ord4, txt4, atoxgr from frq01_01 group by&lt;/P&gt;&lt;P&gt;regionn , ord2, txt2, ord4, txt4, atoxgr;&lt;/P&gt;&lt;P&gt;NOTE: Statement not executed due to NOEXEC option.&lt;/P&gt;&lt;P&gt;MPRINT(OUTPUTS): quit;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So from all what I understand is that the issue is in the first Proc SQL Statement and that&amp;nbsp;the macro variable &lt;STRONG&gt;VAR &lt;/STRONG&gt;is not resolving properly (as a comma ","). Could anybody shed some light. Any help is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:25:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weird-Macro-resolving-issue/m-p/401018#M97234</guid>
      <dc:creator>VinnyR</dc:creator>
      <dc:date>2017-10-04T15:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Weird Macro resolving issue.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weird-Macro-resolving-issue/m-p/401600#M97472</link>
      <description>&lt;P&gt;you have to use comma to between different variables in SELECT and GROUP BY statements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;select count(distinct usubjid) as count, &lt;U&gt;&amp;amp;&lt;/U&gt;&lt;/FONT&gt;&lt;U&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;byvar.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;var.&lt;/FONT&gt;&lt;/U&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;U&gt; ord2&lt;/U&gt;, txt2, ord3, txt3, ord4, txt4 &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;from frq01_01&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;group by &lt;U&gt;&amp;amp;&lt;/U&gt;&lt;/FONT&gt;&lt;U&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;byvar.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;var.&lt;/FONT&gt;&lt;/U&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;U&gt; ord2&lt;/U&gt;, txt2, ord3, txt3, ord4, txt4;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;So put comma between &amp;amp;&lt;FONT color="#008080" face="Courier New" size="3"&gt;byvar.&lt;/FONT&gt; , &amp;amp;&lt;FONT color="#008080" face="Courier New" size="3"&gt;var.&lt;/FONT&gt; , ord2 and if everything else is ok, your code should run&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 04:03:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weird-Macro-resolving-issue/m-p/401600#M97472</guid>
      <dc:creator>ali_jooan</dc:creator>
      <dc:date>2017-10-06T04:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Weird Macro resolving issue.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weird-Macro-resolving-issue/m-p/401621#M97485</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put Byvar is: &amp;amp;byvar.; 
%put Var is: &amp;amp;var.;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Check the log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the value of&amp;nbsp;&lt;FONT face="Courier New" size="3"&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;byvar.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;amp;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;var.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;does not contain a comma (,) then modify your script like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
create table frq02_01 as select count(distinct usubjid) as count, &amp;amp;byvar., &amp;amp;var., ord2, txt2, ord3, txt3, ord4, txt4
from frq01_01
group by &lt;STRONG&gt;&amp;amp;byvar., &amp;amp;var.,&lt;/STRONG&gt; ord2, txt2, ord3, txt3, ord4, txt4;
　
create table frq02_02 as select count(distinct usubjid) as count, &lt;STRONG&gt;&amp;amp;byvar., &amp;amp;var.,&lt;/STRONG&gt; ord2, txt2, ord3, txt3, ord4, txt4, atoxgr
from frq01_01

group by &lt;STRONG&gt;&amp;amp;byvar., &amp;amp;var.,&lt;/STRONG&gt; ord2, txt2, ord3, txt3, ord4, txt4, atoxgr;
create table frq02_03 as select count(distinct usubjid) as count, &lt;STRONG&gt;&amp;amp;byvar., &amp;amp;var.,&lt;/STRONG&gt; ord2, txt2, ord4, txt4
from frq01_01

group by &lt;STRONG&gt;&amp;amp;byvar.,&amp;amp;var.,&lt;/STRONG&gt; ord2, txt2, ord4, txt4;
create table frq02_04 as select count(distinct usubjid) as count, &lt;STRONG&gt;&amp;amp;byvar., &amp;amp;var.,&lt;/STRONG&gt; ord2, txt2, ord4, txt4, atoxgr
from frq01_01
group by &lt;STRONG&gt;&amp;amp;byvar., &amp;amp;var.,&lt;/STRONG&gt; ord2, txt2, ord4, txt4, atoxgr;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 06:05:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weird-Macro-resolving-issue/m-p/401621#M97485</guid>
      <dc:creator>ShiroAmada</dc:creator>
      <dc:date>2017-10-06T06:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Weird Macro resolving issue.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weird-Macro-resolving-issue/m-p/401622#M97486</link>
      <description>&lt;P&gt;Let's re arrange your SQL statement to make it a little easier for humans to scan.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;create table frq02_01 as 
select count(distinct usubjid) as count
     , &amp;amp;byvar. &amp;amp;var. ord2
     , txt2
     , ord3
     , txt3
     , ord4
     , txt4
from frq01_01
group by &amp;amp;byvar. &amp;amp;var. ord2
       , txt2 
       , ord3 
       , txt3 
       , ord4 
       , txt4
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The first thing I notice is that you have no commas between &amp;amp;BYVAR and &amp;amp;VAR or between &amp;amp;VAR and ORD2.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming that the macro code not shown hasn't done anything to change the values of BYVAR and VAR this means that if you pass in any values in those parameters then you will need to include both embedded commas and also add a trailing comma.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now let's look at how you are setting this parameters.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%outputs
(mpop=%str(upcase(isft3fl) = "Y")
,pop=%str(upcase(parcat1) = "HEMATOLOGY")
,byvar=regionn
,var=%str(,) 
,output_name=h
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Looks a little fishy.&amp;nbsp; I would have added the comma to the BYVAR value and left VAR as blank.&amp;nbsp; But combined effect should work as your variable list should look like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select count(distinct usubjid) as count
     , regionn , ord2
     , txt2
     , ord3
     , txt3
     , ord4
     , txt4&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So if SAS is complaining then it is probably because of the macro quoting you had to add to the comma to get it to pass through the macro call.&amp;nbsp; You could just remove the macro quoting. You could do it where you reference the macro variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;     , %unquote(&amp;amp;byvar. &amp;amp;var.) ord2
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or perhaps since you appear to be referencing the macro variables in multiple places you might want to just do it at the top of the macro.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let byvar=%unquote(&amp;amp;byvar);
%let var=%unquote(&amp;amp;var);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 06:07:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weird-Macro-resolving-issue/m-p/401622#M97486</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-10-06T06:07:38Z</dc:date>
    </item>
  </channel>
</rss>

