<?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: Is the macro correct? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108047#M22495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Runs fine. Nothing wrong about your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please share the log and context of your session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers from Portugal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Aug 2012 08:35:58 GMT</pubDate>
    <dc:creator>DanielSantos</dc:creator>
    <dc:date>2012-08-30T08:35:58Z</dc:date>
    <item>
      <title>Is the macro correct?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108042#M22490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote the macro indd and I'm wondering why the macro can't be resolved when I call the macro by: %put&amp;nbsp; i'm running %indd(no).&lt;/P&gt;&lt;P&gt;Is there something wrong with the macro? Thanks in advance. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro indd(in);&lt;/P&gt;&lt;P&gt;%if %upcase(&amp;amp;in)=YES %THEN %do;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%else %do;&lt;/P&gt;&lt;P&gt;noint&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put&amp;nbsp; i'm running %indd(no);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2012 05:46:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108042#M22490</guid>
      <dc:creator>MikeTurner</dc:creator>
      <dc:date>2012-08-30T05:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is the macro correct?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108043#M22491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried the codes on my colleague's computer and it worked fine. But not on my computer. It's so weird. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2012 06:19:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108043#M22491</guid>
      <dc:creator>MikeTurner</dc:creator>
      <dc:date>2012-08-30T06:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is the macro correct?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108044#M22492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Due to this special single quote :&amp;nbsp; i&lt;STRONG&gt;'&lt;/STRONG&gt;m running&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;%macro indd(in);

%if %upcase(&amp;amp;in)=YES %THEN %do;

 yes

%end;

%else %do;

noint

%end;

%mend;

option mprint symbolgen mlogic; 

%put&amp;nbsp; %str(i%'m running) %indd(no) ;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2012 06:41:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108044#M22492</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-08-30T06:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is the macro correct?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108045#M22493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Ksharp&lt;/SPAN&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried your codes and still didn't work. I suspected something wrong with my computer's setting.&lt;/P&gt;&lt;P&gt;I tried your codes and my codes on my colleague's computer and all worked fine.&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2012 06:59:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108045#M22493</guid>
      <dc:creator>MikeTurner</dc:creator>
      <dc:date>2012-08-30T06:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Is the macro correct?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108046#M22494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is so weird .Did you open a new sas session ? What is your log ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2012 07:07:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108046#M22494</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-08-30T07:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is the macro correct?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108047#M22495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Runs fine. Nothing wrong about your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please share the log and context of your session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers from Portugal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2012 08:35:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108047#M22495</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2012-08-30T08:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Is the macro correct?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108048#M22496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I opened &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;a new sas session. It seemed that the codes sometimes worked fine and sometimes not.&amp;nbsp; Please have a look at the log. Thank all. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;16&amp;nbsp;&amp;nbsp; %macro indd(in);&lt;/P&gt;&lt;P&gt;17&amp;nbsp;&amp;nbsp; %if %upcase(&amp;amp;in)=YES %THEN %do;&lt;/P&gt;&lt;P&gt;18&lt;/P&gt;&lt;P&gt;19&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;20&amp;nbsp;&amp;nbsp; %else %do;&lt;/P&gt;&lt;P&gt;21&amp;nbsp;&amp;nbsp; noint&lt;/P&gt;&lt;P&gt;22&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;23&amp;nbsp;&amp;nbsp; %mend;&lt;/P&gt;&lt;P&gt;15&amp;nbsp;&amp;nbsp; %put&amp;nbsp; i'm running %indd(no);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 49&lt;/P&gt;&lt;P&gt;NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; release.&amp;nbsp; Inserting white space between a quoted string and the succeeding&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identifier is recommended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;24&amp;nbsp;&amp;nbsp; option mprint symbolgen mlogic;&lt;/P&gt;&lt;P&gt;25&amp;nbsp;&amp;nbsp; %put&amp;nbsp; i'm running %indd(no);&lt;/P&gt;&lt;P&gt;MLOGIC(INDD):&amp;nbsp; Beginning execution.&lt;/P&gt;&lt;P&gt;MLOGIC(INDD):&amp;nbsp; Parameter IN has value no&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable IN resolves to no&lt;/P&gt;&lt;P&gt;MLOGIC(INDD):&amp;nbsp; %IF condition %upcase(&amp;amp;in)=YES is FALSE&lt;/P&gt;&lt;P&gt;MLOGIC(INDD):&amp;nbsp; Ending execution.&lt;/P&gt;&lt;P&gt;i'm running %indd(no);%macro indd(in);%if %upcase(&amp;amp;in)=YES %THEN %do;%end;%else&lt;/P&gt;&lt;P&gt;%do;noint%end;%mend;option mprint symbolgen mlogic;%put&amp;nbsp; i'm running noint&lt;/P&gt;&lt;P&gt;26&amp;nbsp;&amp;nbsp; %put&amp;nbsp; i'm running %indd(no);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2012 08:47:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108048#M22496</guid>
      <dc:creator>MikeTurner</dc:creator>
      <dc:date>2012-08-30T08:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is the macro correct?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108049#M22497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, I got it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code tested was actually the one Ksharp posted, which runs fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's the ' char inside the %put&lt;/P&gt;&lt;P&gt;It's totally messing the compiler, that's why you get erratic runs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Ksharp suggested, enclose it inside a masking macro functions so the compiler can get the code right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%str(%')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More on masking here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a001061345.htm"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a001061345.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers from Portugal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2012 10:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-the-macro-correct/m-p/108049#M22497</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2012-08-30T10:41:45Z</dc:date>
    </item>
  </channel>
</rss>

