<?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: SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-a-do-loop-index-is-great-than-a-counter-within-do-loop/m-p/459208#M116613</link>
    <description>&lt;P&gt;The loop is incremented&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;at the end of the loop&lt;/STRONG&gt;&lt;/U&gt;.&amp;nbsp; Hence when the end is hit index gets 2 added to it, but as that is greater than 5 it does not loop back to the do part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 May 2018 08:03:51 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-05-02T08:03:51Z</dc:date>
    <item>
      <title>Why a do loop index is great than a counter within do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-a-do-loop-index-is-great-than-a-counter-within-do-loop/m-p/459194#M116607</link>
      <description>&lt;P class="qtext_para"&gt;The following SAS program is submitted:&lt;/P&gt;
&lt;P class="qtext_para"&gt;data WORK.LOOP;&lt;/P&gt;
&lt;P class="qtext_para"&gt;X = 0;&lt;/P&gt;
&lt;P class="qtext_para"&gt;do Index = 1 to 5 by 2;&lt;/P&gt;
&lt;P class="qtext_para"&gt;X = Index;&lt;/P&gt;
&lt;P class="qtext_para"&gt;end;&lt;/P&gt;
&lt;P class="qtext_para"&gt;run;&lt;/P&gt;
&lt;P class="qtext_para"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="qtext_para"&gt;how the answer is coming x=5 and Index=7? can anybody explain me what is happening step by step?&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 08:04:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-a-do-loop-index-is-great-than-a-counter-within-do-loop/m-p/459194#M116607</guid>
      <dc:creator>sukannya1</dc:creator>
      <dc:date>2018-05-02T08:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-a-do-loop-index-is-great-than-a-counter-within-do-loop/m-p/459200#M116609</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P class="qtext_para"&gt;Here&amp;nbsp; you we assigned X=0 and index=1&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P class="qtext_para"&gt;it increments 1 ,3 ,5 and 7 . In index=5 condition is true then X is 5&lt;/P&gt;
&lt;P class="qtext_para"&gt;and again do loop by 2 value is added (index=7) and condition is falls&amp;nbsp;&lt;/P&gt;
&lt;P class="qtext_para"&gt;so X=5 and index=7&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P class="qtext_para"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 06:57:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-a-do-loop-index-is-great-than-a-counter-within-do-loop/m-p/459200#M116609</guid>
      <dc:creator>tlnarayana26</dc:creator>
      <dc:date>2018-05-02T06:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-a-do-loop-index-is-great-than-a-counter-within-do-loop/m-p/459208#M116613</link>
      <description>&lt;P&gt;The loop is incremented&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;at the end of the loop&lt;/STRONG&gt;&lt;/U&gt;.&amp;nbsp; Hence when the end is hit index gets 2 added to it, but as that is greater than 5 it does not loop back to the do part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 08:03:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-a-do-loop-index-is-great-than-a-counter-within-do-loop/m-p/459208#M116613</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-05-02T08:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why a do loop index is great than a counter within do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-a-do-loop-index-is-great-than-a-counter-within-do-loop/m-p/459344#M116655</link>
      <description>&lt;P&gt;Perhaps if you look at the resulting data set done this way it will help.&lt;/P&gt;
&lt;P&gt;This creates an output record for each time the loop executes.&lt;/P&gt;
&lt;PRE&gt;data WORK.LOOP;
   X = 0;
  do Index = 1 to 5 by 2;
     X = Index;
      output;
   end;

run;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 May 2018 14:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-a-do-loop-index-is-great-than-a-counter-within-do-loop/m-p/459344#M116655</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-02T14:51:52Z</dc:date>
    </item>
  </channel>
</rss>

