<?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 Do loop Question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Do-loop-Question/m-p/888485#M351029</link>
    <description>11.4 In the data set Work.Invest, what would be the stored value for Year?&lt;BR /&gt;data work.invest;&lt;BR /&gt;do year=1990 to 2004;&lt;BR /&gt;Capital+5000;&lt;BR /&gt;capital+(capital*.10);&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;a. missing&lt;BR /&gt;b. 1990&lt;BR /&gt;c. 2004&lt;BR /&gt;d. 2005&lt;BR /&gt;Correct answer: d&lt;BR /&gt;At the end of the 15th iteration of the DO loop, the value for Year is incremented to 2005&lt;BR /&gt;&lt;BR /&gt;Dear guys, can I know why it’s not 2004?</description>
    <pubDate>Tue, 08 Aug 2023 23:54:24 GMT</pubDate>
    <dc:creator>JKim8069</dc:creator>
    <dc:date>2023-08-08T23:54:24Z</dc:date>
    <item>
      <title>Do loop Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-loop-Question/m-p/888485#M351029</link>
      <description>11.4 In the data set Work.Invest, what would be the stored value for Year?&lt;BR /&gt;data work.invest;&lt;BR /&gt;do year=1990 to 2004;&lt;BR /&gt;Capital+5000;&lt;BR /&gt;capital+(capital*.10);&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;a. missing&lt;BR /&gt;b. 1990&lt;BR /&gt;c. 2004&lt;BR /&gt;d. 2005&lt;BR /&gt;Correct answer: d&lt;BR /&gt;At the end of the 15th iteration of the DO loop, the value for Year is incremented to 2005&lt;BR /&gt;&lt;BR /&gt;Dear guys, can I know why it’s not 2004?</description>
      <pubDate>Tue, 08 Aug 2023 23:54:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-loop-Question/m-p/888485#M351029</guid>
      <dc:creator>JKim8069</dc:creator>
      <dc:date>2023-08-08T23:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Do loop Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-loop-Question/m-p/888488#M351030</link>
      <description>&lt;P&gt;The index variable (YEAR in your example) is incremented by 1 &lt;EM&gt;&lt;STRONG&gt;at the end of each iteration&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp; The looping will not stop until the index variable is outside of the range (1990 through 2004 in your example).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, in the last iteration YEAR=2004, a valid value.&amp;nbsp; At the end of that iteration, it is incremented to 2005, at which point the index variable first becomes outside of range., and no more loops are executed.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 00:15:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-loop-Question/m-p/888488#M351030</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2023-08-09T00:15:23Z</dc:date>
    </item>
  </channel>
</rss>

