<?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: Apostrophe in a comment in a macro - why after 40+ years does SAS still get &amp;quot;confused&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680275#M205552</link>
    <description>&lt;P&gt;I expect you might already be aware of this, but according to the&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=lestmtsglobal&amp;amp;docsetTarget=n1v51exifva71an1cvfn2z6j26lo.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;documentation on comments&lt;/A&gt;&amp;nbsp;part of the restrictions for the &lt;FONT face="courier new,courier"&gt;*message;&lt;/FONT&gt; style of comment&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;syntax says:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;This form of comment cannot be used to hide text from the SAS macro facility.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So your experience does appear to be consistent with the documentation, i.e., the apostrophe "cannot be used to hide text from the SAS macro facility."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It then also goes on to give the tip:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;TABLE class="xisDoc-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="xisDoc-summaryTip"&gt;Tip&lt;/TH&gt;
&lt;TD class="xisDoc-summaryText"&gt;When using comments within a macro definition or to hide text from the SAS macro facility, use this style comment:
&lt;PRE class="xisDoc-codeFragmentLast"&gt;&lt;CODE&gt;   /* message */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: Fixed typo.&lt;/P&gt;</description>
    <pubDate>Sun, 30 Aug 2020 09:34:09 GMT</pubDate>
    <dc:creator>Amir</dc:creator>
    <dc:date>2020-08-30T09:34:09Z</dc:date>
    <item>
      <title>Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680269#M205548</link>
      <description>&lt;P&gt;This is more a rant than expecting a solution.&amp;nbsp; But comments, likes, or SASWare Ballot entries are more than welcome.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I often use an uncalled macro to comment out a block of code containing slash-asterisk comments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I sometimes use contractions (unmatched apostrophes) in my SAS comments.&amp;nbsp; Which work fine in the SAS code itself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* It's a sad world where an apostrophe in a comment in an uncalled macro causes a problem ;
data bar;set sashelp.class;run;
data foo;    /* the output dataset is named "foo" */
   set bar;  /* the input dataset is named "bar" */
             /* and if I enclose this code in an uncalled macro I get "fubar" */
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Submit that.&amp;nbsp; It runs as expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, say it was a long block of code that I wanted to comment out, and I want the code following it to run.&amp;nbsp; So I change the code to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro comment;

* It's a sad world where an apostrophe in a comment in an uncalled macro causes a problem ;
data bar;set sashelp.class;run;
data foo;    /* the output dataset is named "foo" */
   set bar;  /* the input dataset is named "bar" */
             /* and if I enclose this code in an uncalled macro I get "fubar" */
run;

%mend;

data blah;
   set sashelp.class;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Much anger and gnashing of teeth.&amp;nbsp; I tried submitting the magic tokens from EG&amp;nbsp;;*';*";*/;quit;run; but this didn't fix the problem.&amp;nbsp; The only thing I could think to fix this was restart the server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, anyone who has used SAS more than three months (or less if they start using macro early in their SAS journey) has probably run into this and, with some experience, knows the workaround.&amp;nbsp; Which is "don't do that".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But can anyone explain why this design bug (or do we call these "features"?) would be so hard to fix?&amp;nbsp; Can't the macro processor determine there's an unmatched quote and quote it?&amp;nbsp; Or wrap all * ; style quotes in some super quoting function so the unmatched quote doesn't cause havoc?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is the code to the macro processor so fragile that it can never be touched and therefore fixed?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(In my "real" code, I have a huge program that runs for about 4 hours.&amp;nbsp; I then need to analyze some outputs in the work library.&amp;nbsp; I used this technique to block out about 500 lines of code.&amp;nbsp; Alas, I didn't see that apostrophe, in the comment, in the code that works fine until I wrap it in a macro.&amp;nbsp; I ran it twice before I deduced the problem.&amp;nbsp; There's 8 hours I'll never get back.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2020 07:28:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680269#M205548</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-08-30T07:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680270#M205549</link>
      <description>&lt;P&gt;I have a habit to use /*.....*/ for comments outside of a data step or a proc, while&lt;/P&gt;
&lt;P&gt;using *.....; if the line contains sas statements, like in next example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* It's a sad world where an apostrophe in a comment in an uncalled macro causes a problem */
data bar;set sashelp.class;run;
data foo;    * the output dataset is named "foo" *;
   set bar;  * the input dataset is named "bar" *;
             * and if I enclose this code in an uncalled macro I get "fubar" *;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then in case I want to marl the whole part it is easy:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* It's a sad world where an apostrophe in a comment in an uncalled macro causes a problem *   &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;
data bar;set sashelp.class;run;
data foo;    * the output dataset is named "foo" *;
   set bar;  * the input dataset is named "bar" *;
             * and if I enclose this code in an uncalled macro I get "fubar" *;
run;
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  */     &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 30 Aug 2020 07:53:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680270#M205549</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-08-30T07:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680272#M205550</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15043"&gt;@ScottBass&lt;/a&gt;&amp;nbsp; - I wonder if a macro comment behaves better - %* Can it cope with apostrophes better than normal comments? It's a sad world etc;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2020 08:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680272#M205550</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-08-30T08:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680275#M205552</link>
      <description>&lt;P&gt;I expect you might already be aware of this, but according to the&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=lestmtsglobal&amp;amp;docsetTarget=n1v51exifva71an1cvfn2z6j26lo.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;documentation on comments&lt;/A&gt;&amp;nbsp;part of the restrictions for the &lt;FONT face="courier new,courier"&gt;*message;&lt;/FONT&gt; style of comment&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;syntax says:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;This form of comment cannot be used to hide text from the SAS macro facility.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So your experience does appear to be consistent with the documentation, i.e., the apostrophe "cannot be used to hide text from the SAS macro facility."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It then also goes on to give the tip:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;TABLE class="xisDoc-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="xisDoc-summaryTip"&gt;Tip&lt;/TH&gt;
&lt;TD class="xisDoc-summaryText"&gt;When using comments within a macro definition or to hide text from the SAS macro facility, use this style comment:
&lt;PRE class="xisDoc-codeFragmentLast"&gt;&lt;CODE&gt;   /* message */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: Fixed typo.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2020 09:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680275#M205552</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2020-08-30T09:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680277#M205553</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22588"&gt;@Amir&lt;/a&gt;&amp;nbsp;, as you quoted:&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;This form of comment cannot be used &lt;STRONG&gt;to hide&lt;/STRONG&gt; text from the SAS macro facility."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Which means - be aware of using &amp;amp; and % in a comment, that is a part of a macro - because&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;it should be interpreted&amp;nbsp;as part&amp;nbsp; of the code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Anyhow, having a&amp;nbsp; *message; comment, that does not contain those special characters, will be&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;interpreted as is and finally sas will ignore it.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2020 10:26:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680277#M205553</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-08-30T10:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680278#M205554</link>
      <description>&lt;P&gt;Roughly 25 years ago when I started self-learning use of the macro facility I ran into that behavior with comments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't used any form of comment except the /* */ since then because of the documentation. That way I don't have to "change" from * ; to %* ; commenting.&lt;/P&gt;
&lt;P&gt;The SAS enhanced editor has made it extremely easy to do so: highlight code then CTRL /&lt;/P&gt;
&lt;P&gt;You don't want to nest comments inside comments either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was running some modeling that ran for 4+ DAYS, so I can well understand frustration when something, like the output wasn't designed to create as much output and had fields overwriting each other requiring modification to output statements and then rerunning the code for 4 more days...&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2020 10:44:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680278#M205554</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-08-30T10:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680318#M205567</link>
      <description>&lt;P&gt;My approach for commenting a section of code is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if 0 %then %do;
* It's a sad world where an apostrophe in a comment in an uncalled macro causes a problem ;
data bar;set sashelp.class;run;
data foo;    /* the output dataset is named "foo" */
   set bar;  /* the input dataset is named "bar" */
             /* and if I enclose this code in an uncalled macro I get "fubar" */
run;
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then, if you need to execute the commented coded, just change the first line to :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if 1 %then %do;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Aug 2020 02:42:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680318#M205567</guid>
      <dc:creator>ghosh</dc:creator>
      <dc:date>2020-08-31T02:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680346#M205579</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a habit to use /*.....*/ for comments outside of a data step or a proc, while&lt;/P&gt;
&lt;P&gt;using *.....; if the line contains sas statements, like in next example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* It's a sad world where an apostrophe in a comment in an uncalled macro causes a problem */
data bar;set sashelp.class;run;
data foo;    * the output dataset is named "foo" *;
   set bar;  * the input dataset is named "bar" *;
             * and if I enclose this code in an uncalled macro I get "fubar" *;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then in case I want to marl the whole part it is easy:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* It's a sad world where an apostrophe in a comment in an uncalled macro causes a problem *   &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;
data bar;set sashelp.class;run;
data foo;    * the output dataset is named "foo" *;
   set bar;  * the input dataset is named "bar" *;
             * and if I enclose this code in an uncalled macro I get "fubar" *;
run;
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  */     &lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I have a habit to use * ; comments as much as possible, and /* */ as little as possible.&amp;nbsp; That way I can use /* */ around the entire block to comment out a block of code.&amp;nbsp; If that won't work, I use the uncalled macro "trick" to comment out the block of code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;/* It's a sad world where an apostrophe in a comment in an uncalled macro causes a problem *   &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;
data bar;set sashelp.class;run;
data foo;    * the output dataset is named "foo" *;
   set bar;  * the input dataset is named "bar" *;
             * and if I enclose this code in an uncalled macro I get "fubar" *;
run;
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  */   &lt;/CODE&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This would be &lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;incredibly&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt; tedious to comment out a block of code of any size.&amp;nbsp; Just use an uncalled macro.&amp;nbsp; Just make sure there are no unbalanced quotation marks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 02:12:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680346#M205579</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-08-31T02:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680347#M205580</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15043"&gt;@ScottBass&lt;/a&gt;&amp;nbsp; - I wonder if a macro comment behaves better - %* Can it cope with apostrophes better than normal comments? It's a sad world etc;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nope...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test;
   /* this is a slash-asterisk comment that will not show in MPRINT output */
   %* this is a percent-asterisk comment that will not show in MPRINT output ;
   * this is an asterisk comment that will show in MPRINT output ;
   data one;x=1;run;
%mend; 
options mprint;
%test;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Replace&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;%* this is a percent-asterisk comment that will not show in MPRINT output ; &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;with&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;%* this is a percent-asterisk comment that won't show in MPRINT output ;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And re-submit.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 02:16:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680347#M205580</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-08-31T02:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680348#M205581</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; My approach for commenting a section of code is:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;That's a brand new approach, that just just became possible in the most recent version of SAS.&lt;/P&gt;
&lt;P&gt;And for 40 years SAS has been, and still is, tripped by silly gotchas&lt;U&gt; for no good reason&lt;/U&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And still no way to use &lt;A href="https://communities.sas.com/t5/SASware-Ballot-Ideas/SAS-should-support-a-way-to-add-comments-to-the-right-of-a-code/idi-p/274846" target="_self"&gt;end-of-line comments&lt;/A&gt;, or &lt;A href="https://communities.sas.com/t5/SASware-Ballot-Ideas/assign-line-numbers-to-the-code-generated-by-a-macro/idi-p/219458" target="_self"&gt;easily debug&lt;/A&gt; macro code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 02:31:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680348#M205581</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-08-31T02:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680352#M205585</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22588"&gt;@Amir&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I expect you might already be aware of this, but according to the&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=lestmtsglobal&amp;amp;docsetTarget=n1v51exifva71an1cvfn2z6j26lo.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;documentation on comments&lt;/A&gt;&amp;nbsp;part of the restrictions for the &lt;FONT face="courier new,courier"&gt;*message;&lt;/FONT&gt; style of comment&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;syntax says:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;This form of comment cannot be used to hide text from the SAS macro facility.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So your experience does appear to be consistent with the documentation, i.e., the apostrophe "cannot be used to hide text from the SAS macro facility."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It then also goes on to give the tip:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;TABLE class="xisDoc-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="xisDoc-summaryTip"&gt;Tip&lt;/TH&gt;
&lt;TD class="xisDoc-summaryText"&gt;When using comments within a macro definition or to hide text from the SAS macro facility, use this style comment:
&lt;PRE class="xisDoc-codeFragmentLast"&gt;&lt;CODE&gt;   /* message */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: Fixed typo.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22588"&gt;@Amir&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I read that documentation excerpt differently.&amp;nbsp; I'm not trying to hide anything at all from the macro processor.&amp;nbsp; Instead, I just want a perfectly legal statement in open code - a * ; style &lt;FONT color="#FF0000"&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;comment statement&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&lt;/FONT&gt; containing an apostrophe (unbalanced single quote) - to not turn into a fatal error if I enclose that perfectly legal SAS code within a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run this code, and note the difference in the MPRINT output:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test;
   /* this is a slash-asterisk comment that will not show in MPRINT output */
   %* this is a percent-asterisk comment that will not show in MPRINT output ;
   * this is an asterisk comment that will show in MPRINT output ;
   data one;x=1;run;
%mend; 
options mprint;
%test;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my "real" SAS macros, I often want to use * ; style comments, if I want the MPRINT output to document what the generated SAS code is doing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look, I get it...SAS macro is what 30+ years old?&amp;nbsp; The C code implementing the macro tokenizer probably hasn't been touched in many many years.&amp;nbsp; The original SAS macro developers may have retired (although SAS does have incredible employee loyalty; who'd want to retire when you've got that cafeteria for all your meals?)&amp;nbsp; Fixing this design issue would require programmer's time, testing, backwards compatibility, and other issues.&amp;nbsp; And what is the return on investment to SAS to fix this design issue?&amp;nbsp; Probably less than nil.&amp;nbsp; Spend the programmer's time on stuff that will make money.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And yeah, in a "real" macro, I would just get angry at the current behaviour, then fix the problem.&amp;nbsp; But in my original use case (using an uncalled macro to comment out a block of code), the current behaviour is certainly a PITA.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Like I said, my original post is more of a rant.&amp;nbsp; The rant will either get sympathy and perhaps some traction, or die a quick death.&amp;nbsp; Probably the latter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.:&amp;nbsp; Since my original post, I've discovered the workaround that saves me from having to restart the workspace server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS Log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;27         %macro test;
28            /* this is a slash-asterisk comment that will not show in MPRINT output */
29            %* this is a percent-asterisk comment that &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;won't&lt;/STRONG&gt;&lt;/FONT&gt; show in MPRINT output ;
30            * this is an asterisk comment that will show in MPRINT output ;
31            data one;x=1;run;
32         %mend;
33         options mprint;
34         %test;
35         
36         
37         GOPTIONS NOACCESSIBLE;
38         %LET _CLIENTTASKLABEL=;
39         %LET _CLIENTPROCESSFLOWNAME=;
40         %LET _CLIENTPROJECTPATH=;
41         %LET _CLIENTPROJECTPATHHOST=;
&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;NOTE: The quoted string currently being processed has become more than 262 characters long.  You might have unbalanced 
      quotation marks.&lt;/FONT&gt;&lt;/STRONG&gt;
42         %LET _CLIENTPROJECTNAME=;
43         %LET _SASPROGRAMFILE=;
44         %LET _SASPROGRAMFILEHOST=;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the problem is that a "quoted string" starts with the apostrophe, and the log message kicks in at 262 characters.&amp;nbsp; So what's happened is I started creating a macro, but the macro thinks it contains a long unterminated string, &lt;STRONG&gt;which includes the %mend statement.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So now submit:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%mend;
;*';*";*/;quit;run;&amp;nbsp;&amp;nbsp;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;nbsp;this&amp;nbsp;is&amp;nbsp;optional&amp;nbsp;but&amp;nbsp;does&amp;nbsp;not&amp;nbsp;hurt&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Keep submitting until you get this error:&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&lt;CODE class=" language-sas"&gt;ERROR: No matching %MACRO statement for this %MEND statement.&lt;/CODE&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;You should now have your workspace server back again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Now I've provided R&amp;amp;D even less reason to fix this annoying behaviour &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; )&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 02:48:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680352#M205585</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-08-31T02:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680357#M205589</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Which means - be aware of using &amp;amp; and % &lt;FONT color="#FF0000"&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;i&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;n a comment&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&lt;/FONT&gt;, that is a part of a macro - because&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;it should be interpreted&amp;nbsp;as part&amp;nbsp; of the code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;(Emphasis added)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another mini-rant I guess...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I sometimes feel that SAS uses "works as documented" as a way to explain away "less than ideal" design.&amp;nbsp; I've never accepted that.&amp;nbsp; If in my opinion, the functionality is deficient (at least to me), I'll raise the issue.&amp;nbsp; Documenting poor behaviour does not make it acceptable behaviour.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And in my opinion a comment statement should be able to contain anything, even in a macro.&amp;nbsp; And I can't see this as a hard problem to fix, just a low ROI fix as I stated previously.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you know what they say about opinions...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 03:04:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680357#M205589</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-08-31T03:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680360#M205592</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78622"&gt;@ghosh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;My approach for commenting a section of code is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if 0 %then %do;
* It's a sad world where an apostrophe in a comment in an uncalled macro causes a problem ;
data bar;set sashelp.class;run;
data foo;    /* the output dataset is named "foo" */
   set bar;  /* the input dataset is named "bar" */
             /* and if I enclose this code in an uncalled macro I get "fubar" */
run;
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then, if you need to execute the commented coded, just change the first line to :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if 1 %then %do;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Doesn't work, plus that's conditional execution, not a commenting out of code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test;
%if 0 %then %do;
* It's a sad world where an apostrophe in a comment in an uncalled macro causes a problem ;
data bar;set sashelp.class;run;
data foo;    /* the output dataset is named "foo" */
   set bar;  /* the input dataset is named "bar" */
             /* and if I enclose this code in an uncalled macro I get "fubar" */
run;
%end;
%mend;
%test&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Edit:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I just read&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;'s reply.&amp;nbsp; I'm currently on SAS 9.3, so can't test this.&amp;nbsp; So perhaps this new SAS 9.4 feature of a tiny subset of macro functionality in open code works around this issue by removing the macro tokenizer.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 03:14:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680360#M205592</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-08-31T03:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680366#M205597</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15043"&gt;@ScottBass&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hear you, and I like you I have basically just learned "don't do that."&amp;nbsp; I avoid using any kind of quote mark in a comment.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, &lt;STRONG&gt;there is a way out &lt;/STRONG&gt;for when you get stuck&lt;STRONG&gt;.&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;See below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15043"&gt;@ScottBass&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;...I tried submitting the magic tokens from EG&amp;nbsp;;*';*";*/;quit;run; but this didn't fix the problem.&amp;nbsp; The only thing I could think to fix this was restart the server.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;So the "fix" to get unstuck is in two parts:&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; Highlight the quote (only!) in the comment that got you in trouble in the first place.&amp;nbsp; Run your program with only the quote highlighted.&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; Now highlight %Mend.&amp;nbsp; Run your program with only %Mend highlighted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should now be out of the netherworld of a botched macro compile.&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Don't run again&lt;/STRONG&gt; until you've either commented out or removed the quote that got you in trouble in the first place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do the above two steps and then comment out the offending quote, you can now get a normal run without having to shut everything down (and lose all your work datasets!! &lt;span class="lia-unicode-emoji" title=":face_screaming_in_fear:"&gt;😱&lt;/span&gt; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll put the logs from each step below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem:&lt;/P&gt;
&lt;PRE&gt;29         %macro comment;
30         
31         * It's a sad world where an apostrophe in a comment in an uncalled macro causes a problem ;
32         data bar;set sashelp.class;run;
33         data foo;    /* the output dataset is named "foo" */
34            set bar;  /* the input dataset is named "bar" */
35                      /* and if I enclose this code in an uncalled macro I get "fubar" */
NOTE: The quoted string currently being processed has become more than 262 characters long.  You might have unbalanced 
      quotation marks.
36         run;
37         
38         %mend;
39         
40         data blah;
41            set sashelp.class;
42         run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The log from just highlighting the just quote in the comment and running.&amp;nbsp; The log just has some irrelevant gobbledy-**bleep** from EG:&lt;/P&gt;
&lt;PRE&gt;7          %LET _CLIENTTASKLABEL='Program';
8          %LET _CLIENTPROCESSFLOWNAME='Process Flow';
9          %LET _CLIENTPROJECTPATH='';
10         %LET _CLIENTPROJECTPATHHOST='';
11         %LET _CLIENTPROJECTNAME='';
12         %LET _SASPROGRAMFILE='';
13         %LET _SASPROGRAMFILEHOST='';
14         
15         ODS _ALL_ CLOSE;
16         OPTIONS DEV=SVG;
17         FILENAME EGHTML TEMP;
18         ODS HTML5(ID=EGHTML) FILE=EGHTML
19             OPTIONS(BITMAP_MODE='INLINE')
20             ENCODING='utf-8'
21             STYLE=HTMLBlue
22             NOGTITLE
23             NOGFOOTNOTE
24             GPATH=&amp;amp;sasworklocation
25         ;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But then highlight just the %mend; and run:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;15         ODS _ALL_ CLOSE;
16         OPTIONS DEV=SVG;
17         FILENAME EGHTML TEMP;
18         ODS HTML5(ID=EGHTML) FILE=EGHTML
19             OPTIONS(BITMAP_MODE='INLINE')
20             ENCODING='utf-8'
21             STYLE=HTMLBlue
22             NOGTITLE
23             NOGFOOTNOTE
24             GPATH=&amp;amp;sasworklocation
25         ;
NOTE: The macro COMMENT completed compilation without errors.
      76 instructions 3284 bytes.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The first step of the fix closes the quote; the second completes the macro.&amp;nbsp; Now you have a "clear" EG session.&amp;nbsp; Comment out the offending quote, and run the entire program:&lt;/P&gt;
&lt;PRE&gt;29         %macro comment;
30         
31         /** It's a sad world where an apostrophe in a comment in an uncalled macro causes a problem ;*/
32         data bar;set sashelp.class;run;
33         data foo;    /* the output dataset is named "foo" */
34            set bar;  /* the input dataset is named "bar" */
35                      /* and if I enclose this code in an uncalled macro I get "fubar" */
36         run;
37         
38         %mend;
NOTE: The macro COMMENT completed compilation without errors.
      7 instructions 164 bytes.
39         
40         data blah;
41            set sashelp.class;
42         run;

NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.BLAH has 19 observations and 5 variables.
NOTE: Compressing data set WORK.BLAH increased size by 100.00 percent. 
      Compressed is 2 pages; un-compressed would require 1 pages.
NOTE: DATA statement used (Total process time):
      real time           0:00:00.00
      cpu time            0:00:00.00
      Timestamp           August 31, 2020 00:45:03&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Voila!&amp;nbsp; Working code!&amp;nbsp; (and you didn't have to give up the Work datasets that may have taken you hours&amp;nbsp; of run time to create)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wish I could fix the SAS compiler for you, but at least you now have a way to get out of the netherworld created by a quote inside a comment in a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;While we're on the subject of comment rants, I wish that /* */ style comments could be nested, i.e. that if one applied /* */ comments to a block of code that already contained some&amp;nbsp;/* */ style comments SAS would accept the entire block as a comment.&amp;nbsp; As it is, SAS will stop the comment at the first */ it encounters even if two /*'s preceded the */.&amp;nbsp; My work around is to always use * ; style comments wherever I can so that I can comment out whole blocks of code easily.&amp;nbsp; &amp;nbsp;Yes, the uncalled MACRO-MEND style of comment works for blocks of code for the most part, but as with a quote mark in a comment, even uncalled macros can generate errors.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 06:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680366#M205597</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-08-31T06:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680370#M205599</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15043"&gt;@ScottBass&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hear you, and I like you have basically just learned "don't do that."&amp;nbsp; I avoid using any kind of quote mark in a comment.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While we're on the subject of comment rants, I wish that /* */ style comments could be nested, i.e. that if one applied /* */ comments to a block of code that already contained some&amp;nbsp;/* */ style comments SAS would accept the entire block as a comment.&amp;nbsp; As it is, SAS will stop the comment at the first */ it encounters even if two /*'s preceded the */.&amp;nbsp; My work around is to always use * ; style comments wherever I can so that I can comment out whole blocks of code easily.&amp;nbsp; &amp;nbsp;Yes, the uncalled MACRO-MEND style of comment works for blocks of code for the most part, but as with a quote mark in a comment, even uncalled macros can generate errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd give more likes if I could (or if my reputation score was higher you'd get 2 &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; ).&lt;/P&gt;
&lt;P&gt;I agree with this 100%.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 06:05:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680370#M205599</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-08-31T06:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680372#M205600</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15043"&gt;@ScottBass&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just revised my above comment to include a workaround/fix for how to get unstuck (without shutting down EG and restarting) if you get bit by the quote in a comment in a macro problem.&amp;nbsp; Check it out.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 06:14:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680372#M205600</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-08-31T06:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680380#M205607</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15043"&gt;@ScottBass&lt;/a&gt;&amp;nbsp;reading all of your replies so far gives more context and I expect you're right about this behaviour not changing any time soon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know from the outset you said you weren't expecting a solution, but as an alternative to using a macro definition to comment out some code, you might want to consider &lt;FONT face="courier new,courier"&gt;datalines4&lt;/FONT&gt; (obviously only if your code doesn't have four semicolons in a row), e.g. your original code would become:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   datalines4;
* It's a sad world where an apostrophe in a comment in an uncalled macro causes a problem ;
data bar;set sashelp.class;run;
data foo;    /* the output dataset is named "foo" */
   set bar;  /* the input dataset is named "bar" */
             /* and if I enclose this code in an uncalled macro I get "fubar" */
run;
;;;;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And as for your "real" macros, if you're having to make the effort to "&lt;SPAN&gt;fix the problem&lt;/SPAN&gt;" then a not-pretty preemptive effort could be made by adding a space-apostrophe-space ( ' ) after your original apostrophe, e.g., your example would become:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro comment;

* It' ' s a sad world where an apostrophe in a comment in an uncalled macro causes a problem ;
data bar;set sashelp.class;run;
data foo;    /* the output dataset is named "foo" */
   set bar;  /* the input dataset is named "bar" */
             /* and if I enclose this code in an uncalled macro I get "fubar" */
run;

%mend;

data blah;
   set sashelp.class;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And lastly, maybe just don't use contractions!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&amp;nbsp;Although, the more observant amongst you will note I've used at least one in every sentence in this post! Question is, was that planned or wasn't it?&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 07:46:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680380#M205607</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2020-08-31T07:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40  years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680384#M205610</link>
      <description>It's not only contractions it's also possessives.&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Aug 2020 07:57:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680384#M205610</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-08-31T07:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680389#M205614</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22588"&gt;@Amir&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15043"&gt;@ScottBass&lt;/a&gt;&amp;nbsp;reading all of your replies so far gives more context and I expect you're right about this behaviour not changing any time soon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;SB: This isn't the only SAS idiosyncrasy I don't expect a change to any time soon...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know from the outset you said you weren't expecting a solution, but as an alternative to using a macro definition to comment out some code, you might want to consider &lt;FONT face="courier new,courier"&gt;datalines4&lt;/FONT&gt; (obviously only if your code doesn't have four semicolons in a row), e.g. your original code would become:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   datalines4;
* It's a sad world where an apostrophe in a comment in an uncalled macro causes a problem ;
data bar;set sashelp.class;run;
data foo;    /* the output dataset is named "foo" */
   set bar;  /* the input dataset is named "bar" */
             /* and if I enclose this code in an uncalled macro I get "fubar" */
run;
;;;;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;SB: Thanks, I wouldn't have thought of datalines4.&amp;nbsp; I can have a play with that.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And as for your "real" macros, if you're having to make the effort to "&lt;SPAN&gt;fix the problem&lt;/SPAN&gt;" then a not-pretty preemptive effort could be made by adding a space-apostrophe-space ( ' ) after your original apostrophe, e.g., your example would become:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro comment;

* It' ' s a sad world where an apostrophe in a comment in an uncalled macro causes a problem ;
data bar;set sashelp.class;run;
data foo;    /* the output dataset is named "foo" */
   set bar;  /* the input dataset is named "bar" */
             /* and if I enclose this code in an uncalled macro I get "fubar" */
run;

%mend;

data blah;
   set sashelp.class;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;SB: Nah, I just change "it's" to "it is", "don't" to "do not", etc.&amp;nbsp; I suspect "it%'s" would also work in the MPRINT output, but I've never tried that.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And lastly, maybe just don't use contractions!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&amp;nbsp;Although, the more observant amongst you will note I've used at least one in every sentence in this post! Question is, was that planned or wasn't it?&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;SB: Or just don't comment code.&amp;nbsp; That too is a "solution" &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 08:32:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680389#M205614</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-08-31T08:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Apostrophe in a comment in a macro - why after 40+ years does SAS still get "confused"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680400#M205619</link>
      <description>&lt;P&gt;+1 for&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;While we're on the subject of comment rants, &lt;FONT color="#008000"&gt;&lt;STRONG&gt;I wish that /* */ style comments could be nested&lt;/STRONG&gt;&lt;/FONT&gt;, i.e. that if one applied /* */ comments to a block of code that already contained some&amp;nbsp;/* */ style comments SAS would accept the entire block as a comment.&amp;nbsp; As it is, SAS will stop the comment at the first */ it encounters even if two /*'s preceded the */.&amp;nbsp; My work around is to always use * ; style comments wherever I can so that I can comment out whole blocks of code easily.&amp;nbsp; &amp;nbsp;Yes, the uncalled MACRO-MEND style of comment works for blocks of code for the most part, but as with a quote mark in a comment, even uncalled macros can generate errors.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 09:56:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apostrophe-in-a-comment-in-a-macro-why-after-40-years-does-SAS/m-p/680400#M205619</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-08-31T09:56:41Z</dc:date>
    </item>
  </channel>
</rss>

