<?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 LOOPS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/DO-LOOPS/m-p/125851#M34616</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please give an example. Too much missing dots.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Apr 2013 21:27:03 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2013-04-30T21:27:03Z</dc:date>
    <item>
      <title>DO LOOPS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-LOOPS/m-p/125850#M34615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I am using a do loop in array and new variables being created&amp;nbsp; based on some if/then conditions;&lt;/P&gt;&lt;P&gt;If i did not reset the new variables to missing then there is a chance that their values are carried forward from previous if any of the future ones have a missing value???&lt;/P&gt;&lt;P&gt;is this only in the Do loops??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Apr 2013 20:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-LOOPS/m-p/125850#M34615</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-04-30T20:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: DO LOOPS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-LOOPS/m-p/125851#M34616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please give an example. Too much missing dots.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Apr 2013 21:27:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-LOOPS/m-p/125851#M34616</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-04-30T21:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: DO LOOPS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-LOOPS/m-p/125852#M34617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any datastep with multiple Output statements will output the values of any variables at the time of execution. Do loops coupled with arrays are basically just a shorthand form of doing the same calculations multiple times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example;&lt;/P&gt;&lt;P&gt;varx = vary +3;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;varx = varz -2;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;creates two records with different values of varx but any other variables have the values at the time of the Output statement execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You only have to worry about the "carrying forward" of the missing values within the current execution of The Do loop. Fi a new value is NOT assigned for a variable then yes it will have the same value as the previous pass through the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the values are reset with values for the next record from Set or Input statements. (Warning: Retain statement is designed to work around this behavior. OR if you have multiple Set or Input statements things could get very confusing quickly.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In one of your other posts I recommended a way to output a bunch of new variables corresponding to each variable in your arrays so that a corresponding outcome was directly tied to the input instead of a simple flag that basically said "one of the conditions was met somewhere in the comparisons". I believe that approach lends itself in general to better analysis in many cases because then it has which and how many of the comparisons were met/failed instead of trying to create very complicated logic straight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Apr 2013 22:27:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-LOOPS/m-p/125852#M34617</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-04-30T22:27:41Z</dc:date>
    </item>
  </channel>
</rss>

