<?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 until loop in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-until-loop/m-p/102694#M753</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Oct 2013 01:18:11 GMT</pubDate>
    <dc:creator>Ioana</dc:creator>
    <dc:date>2013-10-04T01:18:11Z</dc:date>
    <item>
      <title>Do until loop</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-until-loop/m-p/102690#M749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to SAS and I would like to know how to tweak this program to break the infinite do until loop. At the end of the do until loop I would like to be able to print the updated phi. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 16:43:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-until-loop/m-p/102690#M749</guid>
      <dc:creator>Ioana</dc:creator>
      <dc:date>2013-10-03T16:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Do until loop</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-until-loop/m-p/102691#M750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With any DO UNTIL loop, it is possible that it never ends because the UNTIL condition never becomes true.&amp;nbsp; In your case, this condition might never become true:&amp;nbsp; (n &amp;lt; 0.001)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way to guard against it is to allow two ways for the loop to end:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do k=1 to 100000 until (n &amp;lt; 0.001);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the loop iterates 100,000 times, it will end regardless of the value of n.&amp;nbsp; Your subsequent statements might have to allow for the possibility that n &amp;gt; 0.001.&amp;nbsp; The loop will end before 100,000 iterations if the UNTIL condition becomes true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 17:24:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-until-loop/m-p/102691#M750</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-10-03T17:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Do until loop</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-until-loop/m-p/102692#M751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Welcome to SAS!&amp;nbsp; To break the infinite DO UNTIL loop, I often include a maximum number of iterations, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maxIter = 50;&lt;/P&gt;&lt;P&gt;iter = 0;&lt;/P&gt;&lt;P&gt;do until(n&amp;lt;0.001 | iter&amp;gt;=maxIter);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /* computations */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; n = sqrt(direc[##]);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; iter = iter + 1;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I might offer another suggestion, your computation is looping over the I variable 50,000 times and updating elements of vectors. It might be possible for you to eliminate that loop. For ideas, see&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://blogs.sas.com/content/iml/2013/05/15/vectorize-computations/"&gt;http://blogs.sas.com/content/iml/2013/05/15/vectorize-computations/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 17:33:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-until-loop/m-p/102692#M751</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-10-03T17:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Do until loop</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-until-loop/m-p/102693#M752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2013 01:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-until-loop/m-p/102693#M752</guid>
      <dc:creator>Ioana</dc:creator>
      <dc:date>2013-10-04T01:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Do until loop</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-until-loop/m-p/102694#M753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2013 01:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Do-until-loop/m-p/102694#M753</guid>
      <dc:creator>Ioana</dc:creator>
      <dc:date>2013-10-04T01:18:11Z</dc:date>
    </item>
  </channel>
</rss>

