<?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: comment out a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364791#M86551</link>
    <description>&lt;P&gt;NO! * will most often NOT work to comment out code in a macro, only %* &amp;nbsp;and the /* */ combination.&lt;/P&gt;
&lt;P&gt;One always can run into a problem is trying to comment out code that already has code commented statements imbedded in it. For that, as far as I know, there isn't a readily available method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jun 2017 23:02:17 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-06-06T23:02:17Z</dc:date>
    <item>
      <title>comment out a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364776#M86543</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I trying to comment out a macro, do I use *% or %*? what difference?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro testA;&lt;/P&gt;
&lt;P&gt;*......;&lt;/P&gt;
&lt;P&gt;%mend testA;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%*testA;&lt;/P&gt;
&lt;P&gt;*%testA;&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;I hope my question is clear, if not. please let me rephrase it:&lt;BR /&gt;%testA is a user defined macro.&lt;BR /&gt;I don't want it be executed, so I add a '*'&lt;BR /&gt;*%testA;&lt;BR /&gt;My question is how it compare with %*testA?&lt;BR /&gt;Looks either way will not execute the macro(all works).&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 03:32:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364776#M86543</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2017-06-07T03:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: comment out a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364778#M86544</link>
      <description>&lt;P&gt;%* is a macro comment&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* and */ also works for me&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also give the macro some name that won't ever be called (easy enough to change it back if you decide you want the macro). For example,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro dont_do_this;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 22:15:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364778#M86544</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-06-06T22:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: comment out a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364780#M86546</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10531"&gt;@GeorgeSAS&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Comparison of the different comment syntax here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n17rxjs5x93mghn1mdxesvg78drx.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n17rxjs5x93mghn1mdxesvg78drx.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 22:16:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364780#M86546</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-06-06T22:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: comment out a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364785#M86548</link>
      <description>How about *%testA;?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 06 Jun 2017 22:35:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364785#M86548</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2017-06-06T22:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: comment out a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364790#M86550</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10531"&gt;@GeorgeSAS&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;What does the documentation tell you how such a comment needs to be terminated?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 23:07:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364790#M86550</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-06-06T23:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: comment out a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364791#M86551</link>
      <description>&lt;P&gt;NO! * will most often NOT work to comment out code in a macro, only %* &amp;nbsp;and the /* */ combination.&lt;/P&gt;
&lt;P&gt;One always can run into a problem is trying to comment out code that already has code commented statements imbedded in it. For that, as far as I know, there isn't a readily available method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 23:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364791#M86551</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-06-06T23:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: comment out a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364815#M86562</link>
      <description>&lt;P&gt;I hope my question is clear, if not. please let me rephrase it:&lt;BR /&gt;%testA is a user defined macro.&lt;BR /&gt;I don't want it be executed, so I add a '*'&lt;BR /&gt;*%testA;&lt;BR /&gt;My question is how it compare with %*testA?&lt;BR /&gt;Looks either way will not execute the macro(all works).&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 03:31:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364815#M86562</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2017-06-07T03:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: comment out a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364817#M86564</link>
      <description>&lt;P&gt;As long as it isn't being called from within a macro, then&amp;nbsp;*%testA; should work as well as /* &amp;nbsp;*/.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've never used the macro style comment (*%) outside of macros, but presume it would work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 04:01:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/364817#M86564</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-06-07T04:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: comment out a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/365050#M86657</link>
      <description>&lt;P&gt;Context of where the code you comment can make a difference.&lt;/P&gt;
&lt;P&gt;I fought briefly with this many years ago and settled on ALWAYS using the /* */.&lt;/P&gt;
&lt;P&gt;For one thing that style can be used in the middle of statement such as&lt;/P&gt;
&lt;P&gt;data junk;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set morejunk (keep= thisvar var10 thatvar /* tempvar*/ );&lt;/P&gt;
&lt;P&gt;which neither of *; or %*; will do and the /* */ works inside macros as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And with the enhanced editor having the Ctrl-/ key stroke to comment entire blocks&amp;nbsp;lines and Shift-Ctrl-/ to uncomment it isn't much additional work. (though you do have to be very careful and not nest creating&amp;nbsp;/* /*&amp;nbsp;&amp;nbsp; */ */ comments).&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 15:38:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/365050#M86657</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-07T15:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: comment out a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/365062#M86660</link>
      <description>&lt;P&gt;If you have a program that is calling a macro like it was a statement with a teminating semi-colon.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%mymacro(...);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you insert an * before the statement then it will look like a comment statement. And if you insert the * after the % then it will look like a macro comment statement. &amp;nbsp;In open code either method will work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But inside of another macro definition only the macro comment will work. &amp;nbsp;The comment statement is no different to the macro processor than any other SAS statement that the macro is generating. So it will generate the code that the %mymacro() call generates and the first SAS statement in the resulting code will become a comment since it now starts with * that preceeded in it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if your macro call does not have a semi-colon after it then you also need to make sure to add one or else the next statment will become part of the comment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 15:55:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/365062#M86660</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-07T15:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: comment out a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/365064#M86661</link>
      <description>Thank you all!&lt;BR /&gt;&lt;BR /&gt;%macro test;&lt;BR /&gt;%put a;&lt;BR /&gt;*%put b;&lt;BR /&gt;%*put c;&lt;BR /&gt;/*%put d;*/&lt;BR /&gt;%put abcd;&lt;BR /&gt;%mend test;&lt;BR /&gt;%test;</description>
      <pubDate>Wed, 07 Jun 2017 16:07:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/365064#M86661</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2017-06-07T16:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: comment out a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/365109#M86682</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;One always can run into a problem is trying to comment out code that already has code commented statements imbedded in it. For that, as far as I know, there isn't a readily available method.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The method to comment out code that has commented statements embedded into it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;inside a macro, use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if 0 %then %do;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If not inside a macro, then you can comment out this section by making it a macro that is never called:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro dont_do_this;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Naturally, you might want to add a comment statement just before you do this explaining that you are&amp;nbsp;commenting out a whole block of code.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 17:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comment-out-a-macro/m-p/365109#M86682</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-06-07T17:33:55Z</dc:date>
    </item>
  </channel>
</rss>

