<?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 basics in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DO-loop-basics/m-p/357006#M83771</link>
    <description>&lt;P&gt;Thanks mr.KurtBremser.I am still in the learning curve.&lt;/P&gt;</description>
    <pubDate>Mon, 08 May 2017 20:13:14 GMT</pubDate>
    <dc:creator>Sathiskumar_D</dc:creator>
    <dc:date>2017-05-08T20:13:14Z</dc:date>
    <item>
      <title>DO loop basics</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DO-loop-basics/m-p/356788#M83707</link>
      <description>&lt;PRE&gt;data WORK.LOOP;
  X = 0;
  do Index = 1 to 5  by  2;
    X = Index;
  end;
run;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Upon completion of execution, what are the values of the variables X and Index in the SAS data set named WORK.LOOP?&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;X = 3, Index = 5&lt;/LI&gt;&lt;LI&gt;X = 5, Index = 5&lt;/LI&gt;&lt;LI&gt;X = 5, Index = 6&lt;/LI&gt;&lt;LI&gt;X = 5, Index = 7&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I knew the answer was X=5 and index=7;&lt;/P&gt;&lt;P&gt;Question is : When the index =5, isn't &amp;nbsp;the program stop executing DO loop and gives the answer of index=5 and x=5.However, the answer was X=5 and index=.How??????&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 06:15:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DO-loop-basics/m-p/356788#M83707</guid>
      <dc:creator>Sathiskumar_D</dc:creator>
      <dc:date>2017-05-08T06:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: DO loop basics</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DO-loop-basics/m-p/356789#M83708</link>
      <description>&lt;P&gt;A do loop works like that:&lt;/P&gt;
&lt;P&gt;1 - set the iteration variable to the start value&lt;/P&gt;
&lt;P&gt;2 - compare to the end value&lt;/P&gt;
&lt;P&gt;3 - if less or equal to the end value (greater or equal if the by value is negative), enter the body of the do, otherwise goto 6&lt;/P&gt;
&lt;P&gt;4 - at the end of the body, increment by the by value&lt;/P&gt;
&lt;P&gt;5 - goto 2&lt;/P&gt;
&lt;P&gt;6 - end&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you see that the iteration variable needs to &lt;U&gt;exceed&lt;/U&gt; the end value to terminate the iterative do loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 06:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DO-loop-basics/m-p/356789#M83708</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-08T06:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: DO loop basics</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DO-loop-basics/m-p/356880#M83741</link>
      <description>&lt;P&gt;For added education use BY 3; and predict the values.&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 14:37:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DO-loop-basics/m-p/356880#M83741</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-08T14:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: DO loop basics</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DO-loop-basics/m-p/357006#M83771</link>
      <description>&lt;P&gt;Thanks mr.KurtBremser.I am still in the learning curve.&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 20:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DO-loop-basics/m-p/357006#M83771</guid>
      <dc:creator>Sathiskumar_D</dc:creator>
      <dc:date>2017-05-08T20:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: DO loop basics</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DO-loop-basics/m-p/429002#M105943</link>
      <description>&lt;P&gt;Thanks for explaining.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 04:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DO-loop-basics/m-p/429002#M105943</guid>
      <dc:creator>kaurbal</dc:creator>
      <dc:date>2018-01-19T04:17:47Z</dc:date>
    </item>
  </channel>
</rss>

