<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Do-Loop/m-p/549872#M152635</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When index=5 and the interpreter meets the "end" statements, il loops back to the do&lt;/P&gt;
&lt;P&gt;statement, increments index by 2 and compare the result to 5 =&amp;gt; index=7&amp;gt;5 so the loop stops.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Apr 2019 09:00:34 GMT</pubDate>
    <dc:creator>gamotte</dc:creator>
    <dc:date>2019-04-10T09:00:34Z</dc:date>
    <item>
      <title>Do Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-Loop/m-p/549865#M152633</link>
      <description>&lt;P&gt;Data Loop;&lt;BR /&gt;X=0;&lt;BR /&gt;do Index = 1 to 5 by 2;&lt;BR /&gt;x=Index;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;X=5 , Index=7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why is index=7.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 08:30:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-Loop/m-p/549865#M152633</guid>
      <dc:creator>swayto</dc:creator>
      <dc:date>2019-04-10T08:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Do Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-Loop/m-p/549872#M152635</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When index=5 and the interpreter meets the "end" statements, il loops back to the do&lt;/P&gt;
&lt;P&gt;statement, increments index by 2 and compare the result to 5 =&amp;gt; index=7&amp;gt;5 so the loop stops.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 09:00:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-Loop/m-p/549872#M152635</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2019-04-10T09:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Do Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-Loop/m-p/549873#M152636</link>
      <description>&lt;P&gt;Adding a put statement in the loop could be helpful to understand what's happening.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 09:01:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-Loop/m-p/549873#M152636</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-04-10T09:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Do Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-Loop/m-p/549914#M152651</link>
      <description>&lt;P&gt;A loop like yours is compiled to this (and the same is true for any programming language that has an iterative loop):&lt;/P&gt;
&lt;PRE&gt;index = 1
start:
if index &amp;gt; 5 goto end
(loop code)
index + 2
goto start
end:&lt;/PRE&gt;
&lt;P&gt;so you see that the index needs to go&amp;nbsp;&lt;EM&gt;past&lt;/EM&gt; the end value for the loop to exit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 11:11:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-Loop/m-p/549914#M152651</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-04-10T11:11:40Z</dc:date>
    </item>
  </channel>
</rss>

