<?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: %do loop error? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666626#M199487</link>
    <description>Duplicate %end? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Thu, 02 Jul 2020 15:22:49 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-07-02T15:22:49Z</dc:date>
    <item>
      <title>%do loop error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666616#M199480</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a program shown below.&amp;nbsp; An error message was shown in the log window.&amp;nbsp;&amp;nbsp; Please help me to fix it.&amp;nbsp; Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%Macro format_Repeater;

	data Repeater_Rochester_a;
		set Repeater_Rochester;

	%do k = 1 %to 5;
	 		CaseID_&amp;amp;k. = compress(CaseID_&amp;amp;k., "_-");
	%end;
   
		put CaseID_&amp;amp;k.;
	run;
	%end;

%mend;
%format_Repeater;
&lt;/PRE&gt;
&lt;P&gt;The error message is list below.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2020 15:15:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666616#M199480</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2020-07-02T15:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: %do loop error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666620#M199482</link>
      <description>You forgot the error message, but it looks like you're mixing macro and array logic. Is there a specific reason to not stick with arrays?</description>
      <pubDate>Thu, 02 Jul 2020 15:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666620#M199482</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-02T15:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: %do loop error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666622#M199484</link>
      <description>&lt;P&gt;I am not sure what is going on, somehow I couldn't copy the error text here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2020 15:18:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666622#M199484</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2020-07-02T15:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: %do loop error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666623#M199485</link>
      <description>&lt;P&gt;Error:&amp;nbsp; There is no matching %DO statement for the %end.&amp;nbsp; The statement will be ignored.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2020 15:19:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666623#M199485</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2020-07-02T15:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: %do loop error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666625#M199486</link>
      <description>&lt;P&gt;Never mind.&amp;nbsp; I found out the issue.&amp;nbsp; thank.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2020 15:21:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666625#M199486</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2020-07-02T15:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: %do loop error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666626#M199487</link>
      <description>Duplicate %end? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 02 Jul 2020 15:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666626#M199487</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-02T15:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: %do loop error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666642#M199493</link>
      <description>&lt;P&gt;You have two %END statements and only one %DO statement.&amp;nbsp; And neither is in the right place.&lt;/P&gt;
&lt;P&gt;If you keep the first one then you will reference the macro variable K after the end of he %DO loop. In that case its value will be 6.&lt;/P&gt;
&lt;P&gt;If you keep the second one then you have included the RUN statement into the %DO loop and the statements generated by K=2 to 5 will be outside of the data step.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2020 16:30:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop-error/m-p/666642#M199493</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-02T16:30:30Z</dc:date>
    </item>
  </channel>
</rss>

