<?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: Comments inside macro %IF statements? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Comments-inside-macro-IF-statements/m-p/256661#M17985</link>
    <description>&lt;P&gt;Macro commenting&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%*this is my comment;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 14 Mar 2016 23:44:34 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-03-14T23:44:34Z</dc:date>
    <item>
      <title>Comments inside macro %IF statements?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Comments-inside-macro-IF-statements/m-p/256659#M17984</link>
      <description>&lt;P&gt;I am writing a macro with a rather complicated IF statement - however I noticed when I put comments inside I get this annoying error:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;ERROR: There is no matching %IF statement for the %ELSE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really dont have the option to *not* write comments, is there some other way I can do this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%global testvar;
%global check;
%let testvar=5;

%MACRO printme(check);

%IF &amp;amp;testvar=1 %THEN
%DO; 
%let check = 1; 
%put testvar is &amp;amp;testvar and check was &amp;amp;check; 
%END; 
* comment ;
%ELSE %IF &amp;amp;testvar=2 %THEN
%DO; 
%let check = 1; 
%put testvar is &amp;amp;testvar and check was &amp;amp;check; 
%END; 
* comment ;
%ELSE %IF &amp;amp;testvar=3 %THEN
%DO; 
%let check = 1; 
%put testvar is &amp;amp;testvar and check was &amp;amp;check; 
%END; 
* comment ;
%ELSE %IF &amp;amp;testvar=4 %THEN
%DO; 
%let check = 1; 
%put testvar is &amp;amp;testvar and check was &amp;amp;check; 
%END; 
* comment ;
%ELSE %IF &amp;amp;testvar=5 %THEN
%DO; 
%let check = 1; 
%put testvar is &amp;amp;testvar and check was &amp;amp;check; 
%END; 
* comment ;
%ELSE %IF &amp;amp;testvar=6 %THEN
%DO; 
%let check = 1; 
%put testvar is &amp;amp;testvar and check was &amp;amp;check; 
%END; 
* comment ;
%ELSE %IF &amp;amp;testvar=7 %THEN
%DO; 
%let check = 1; 
%put testvar is &amp;amp;testvar and check was &amp;amp;check; 
%END; 
* comment ;
%ELSE %IF &amp;amp;testvar=8 %THEN 
%DO; 
%let check = 1; 
%put testvar is &amp;amp;testvar and check was &amp;amp;check; 
%END; 
* comment ;
%ELSE
%DO; 
%let check = 1; 
%put testvar is &amp;amp;testvar and check was &amp;amp;check; 
%END; 

%MEND printme;
%printme;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 23:42:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Comments-inside-macro-IF-statements/m-p/256659#M17984</guid>
      <dc:creator>JBerry</dc:creator>
      <dc:date>2016-03-14T23:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Comments inside macro %IF statements?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Comments-inside-macro-IF-statements/m-p/256661#M17985</link>
      <description>&lt;P&gt;Macro commenting&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%*this is my comment;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Mar 2016 23:44:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Comments-inside-macro-IF-statements/m-p/256661#M17985</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-14T23:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Comments inside macro %IF statements?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Comments-inside-macro-IF-statements/m-p/256715#M17988</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to ask, why are you doing that in macro? &amp;nbsp;It seems like a large amount of difficult to read, and hard to maintain code, for no apparent benefit. &amp;nbsp;Use SAS Base - which is designed to process and manipulate data for data processing and manipulation. &amp;nbsp;Macro is for generating repetitive code, it is not for data processing and manipulation:&lt;/P&gt;
&lt;PRE&gt;%let testvar=5;
data _null_;
  if &amp;amp;testvar. in (1,2,3,4,5,6,7) then call symputx('check',1);
run;
%put testvar. is &amp;amp;testvar. and check was &amp;amp;check.;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Mar 2016 10:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Comments-inside-macro-IF-statements/m-p/256715#M17988</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-15T10:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Comments inside macro %IF statements?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Comments-inside-macro-IF-statements/m-p/256847#M17990</link>
      <description>&lt;P&gt;Thanks, but this was just a simplified made-up example to illustrate my problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In reality, what I'm doing involves many macros passing variables back and forth and doing a variety of data tasks, so its quite complicated to post here.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2016 16:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Comments-inside-macro-IF-statements/m-p/256847#M17990</guid>
      <dc:creator>JBerry</dc:creator>
      <dc:date>2016-03-15T16:57:42Z</dc:date>
    </item>
  </channel>
</rss>

