<?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: Combining Iterative and Conditional DO Loops in Programming 1 and 2</title>
    <link>https://communities.sas.com/t5/Programming-1-and-2/Combining-Iterative-and-Conditional-DO-Loops/m-p/731581#M742</link>
    <description>&lt;P&gt;I guess the particulars of the question could be justified if the incoming data is annual, with a variable named AMOUNT representing an a monthly amount to be added for each year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then savings is a new variable to be generated representing accrued value of deposits plus monthly interest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Apr 2021 12:55:33 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2021-04-06T12:55:33Z</dc:date>
    <item>
      <title>Combining Iterative and Conditional DO Loops</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Combining-Iterative-and-Conditional-DO-Loops/m-p/731550#M739</link>
      <description>&lt;P&gt;Hi all SAS Users,&lt;/P&gt;
&lt;P&gt;Today I did things with Do...Loop and there is one thing quite ambiguous to me.&lt;/P&gt;
&lt;P&gt;In the last demo of lesson 6 of Programming 2, you have the code as below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_0-1617703503898.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56982i44BD8C237A00F649/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_0-1617703503898.png" alt="Phil_NZ_0-1617703503898.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am wondering why do not you set up the statement 'Saving=0;' right after the statement 'Month=0' as the previous demo:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_1-1617703622296.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56983i03535858561A9BDF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_1-1617703622296.png" alt="Phil_NZ_1-1617703622296.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I know the results from the code is right, &lt;STRONG&gt;but why do not we add one more statement for resetting Saving=0&lt;/STRONG&gt;, because from my point of view, the Saving of one person will be retained and need to be set up back to zero for calculating for the next person.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2021 10:09:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Combining-Iterative-and-Conditional-DO-Loops/m-p/731550#M739</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-04-06T10:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Iterative and Conditional DO Loops</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Combining-Iterative-and-Conditional-DO-Loops/m-p/731558#M740</link>
      <description>&lt;P&gt;You are right, because the SUM statement will cause Savings to be implicitly RETAINed.&lt;/P&gt;
&lt;P&gt;IMO the authors overlooked that.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2021 10:57:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Combining-Iterative-and-Conditional-DO-Loops/m-p/731558#M740</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-06T10:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Iterative and Conditional DO Loops</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Combining-Iterative-and-Conditional-DO-Loops/m-p/731560#M741</link>
      <description>Most likely, the incoming data set contains SAVINGS.  So the SET statement brings in a new value for each observation.</description>
      <pubDate>Tue, 06 Apr 2021 10:59:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Combining-Iterative-and-Conditional-DO-Loops/m-p/731560#M741</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-04-06T10:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Iterative and Conditional DO Loops</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Combining-Iterative-and-Conditional-DO-Loops/m-p/731581#M742</link>
      <description>&lt;P&gt;I guess the particulars of the question could be justified if the incoming data is annual, with a variable named AMOUNT representing an a monthly amount to be added for each year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then savings is a new variable to be generated representing accrued value of deposits plus monthly interest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2021 12:55:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Combining-Iterative-and-Conditional-DO-Loops/m-p/731581#M742</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2021-04-06T12:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Iterative and Conditional DO Loops</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Combining-Iterative-and-Conditional-DO-Loops/m-p/731588#M743</link>
      <description>&lt;P&gt;Astounding is correct.&amp;nbsp; The pg2.savings2 table has a savings column.&amp;nbsp; When the set statement executes, it overwrites the savings value in the program data vector (PDV).&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2021 13:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Combining-Iterative-and-Conditional-DO-Loops/m-p/731588#M743</guid>
      <dc:creator>Al14</dc:creator>
      <dc:date>2021-04-06T13:27:11Z</dc:date>
    </item>
  </channel>
</rss>

