<?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 Modifying a macro. Error: The %DO statement is not valid in open code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Modifying-a-macro-Error-The-DO-statement-is-not-valid-in-open/m-p/210154#M267359</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;I am trying to modify a macro (&lt;A href="http://www.agreestat.com/software/AgreeStat_2SAS.sas" title="http://www.agreestat.com/software/AgreeStat_2SAS.sas"&gt;http://www.agreestat.com/software/AgreeStat_2SAS.sas&lt;/A&gt;) by adding a DO LOOP but am getting an error: The %DO statement is not valid in open code. Really not sure why .. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro acboot;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%do M=1 %to &amp;amp;REPS;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data boot_input;&lt;/P&gt;&lt;P&gt; set &amp;amp;bootdata;&lt;/P&gt;&lt;P&gt; where replicate=&amp;amp;M;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let inputfile=boot_input;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Macro Code&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&amp;lt;Macro Code&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&amp;lt;Macro Code&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend acboot;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Firstly, I get an error when I compile the macro (There is no matching %DO statement for the %END. This statement will be ignored). This is for the %end inserted right at the end of the code. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;And then I get the %DO statement error when I run the macro.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jul 2015 18:28:56 GMT</pubDate>
    <dc:creator>SSandman</dc:creator>
    <dc:date>2015-07-23T18:28:56Z</dc:date>
    <item>
      <title>Modifying a macro. Error: The %DO statement is not valid in open code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Modifying-a-macro-Error-The-DO-statement-is-not-valid-in-open/m-p/210154#M267359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;I am trying to modify a macro (&lt;A href="http://www.agreestat.com/software/AgreeStat_2SAS.sas" title="http://www.agreestat.com/software/AgreeStat_2SAS.sas"&gt;http://www.agreestat.com/software/AgreeStat_2SAS.sas&lt;/A&gt;) by adding a DO LOOP but am getting an error: The %DO statement is not valid in open code. Really not sure why .. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro acboot;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%do M=1 %to &amp;amp;REPS;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data boot_input;&lt;/P&gt;&lt;P&gt; set &amp;amp;bootdata;&lt;/P&gt;&lt;P&gt; where replicate=&amp;amp;M;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let inputfile=boot_input;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Macro Code&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&amp;lt;Macro Code&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&amp;lt;Macro Code&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend acboot;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Firstly, I get an error when I compile the macro (There is no matching %DO statement for the %END. This statement will be ignored). This is for the %end inserted right at the end of the code. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;And then I get the %DO statement error when I run the macro.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 18:28:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Modifying-a-macro-Error-The-DO-statement-is-not-valid-in-open/m-p/210154#M267359</guid>
      <dc:creator>SSandman</dc:creator>
      <dc:date>2015-07-23T18:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying a macro. Error: The %DO statement is not valid in open code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Modifying-a-macro-Error-The-DO-statement-is-not-valid-in-open/m-p/210155#M267360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That error is usually a side effect of missing semi-colons, unbalanced quotes or unbalanced comments or other problems that result in SAS not seeing the %MACRO statement.&lt;/P&gt;&lt;P&gt;Start over with a fresh SAS session.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 18:47:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Modifying-a-macro-Error-The-DO-statement-is-not-valid-in-open/m-p/210155#M267360</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-07-23T18:47:29Z</dc:date>
    </item>
  </channel>
</rss>

