<?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: advantage of DO UNTIL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/advantage-of-DO-UNTIL/m-p/257440#M49429</link>
    <description>&lt;P&gt;One generic "difference" is along the lines of "test at the top" and "test at the bottom". "Do While" means the intial value usually is set before the loop and often executes at least once because of the initial value. "Do until" is more often used to check the condition at the end of one execution fo the loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or treat as "do until this condition that is initially true is no longer true" and "Do until this condtion that is initially false is&amp;nbsp;true"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Usually with work one can get the same results with either loop construct.&lt;/P&gt;
&lt;P&gt;Be very leery of using Do Until or Do While with non-integer numerics and and Equal comparison especially if calculating the loop control as you might not get "equality" do to a variety of reasons with the sneakiest being precision issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider this program:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   x=0;
   do until(x=1);
      x=x+0.01;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Do not run this if you do not know how to interrupt a program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Mar 2016 20:04:44 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-03-17T20:04:44Z</dc:date>
    <item>
      <title>advantage of DO UNTIL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/advantage-of-DO-UNTIL/m-p/257412#M49416</link>
      <description>&lt;P&gt;What advantage can be made of DO UNTIL over DO WHILE &amp;nbsp;in programming because of the fact that DO UNTIL executes at least once?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 18:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/advantage-of-DO-UNTIL/m-p/257412#M49416</guid>
      <dc:creator>SAS_inquisitive</dc:creator>
      <dc:date>2016-03-17T18:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: advantage of DO UNTIL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/advantage-of-DO-UNTIL/m-p/257429#M49424</link>
      <description>Mainly semantics I guess. And save a line of code or two compared to while, given the situation. &lt;BR /&gt;You seen very interested in these matters, any specific problem you wish to solve? &lt;BR /&gt;The while and until constructs exists in many programming languages. There must lot of literature to browse that can guide you.</description>
      <pubDate>Thu, 17 Mar 2016 19:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/advantage-of-DO-UNTIL/m-p/257429#M49424</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-17T19:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: advantage of DO UNTIL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/advantage-of-DO-UNTIL/m-p/257435#M49427</link>
      <description>&lt;P&gt;In general the advantage is not having the repeat the same block of code before the DO loop and inside the DO loop.&lt;/P&gt;
&lt;P&gt;So you can convert code like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;lt; get an item &amp;gt;
do while (not &amp;lt;condition&amp;gt;);
  &amp;lt;do something&amp;gt;
  &amp;lt;get an item&amp;gt;
end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;do until (&amp;lt;condition&amp;gt;);
  &amp;lt;get an item&amp;gt;
  &amp;lt;do something&amp;gt;
end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Mar 2016 19:52:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/advantage-of-DO-UNTIL/m-p/257435#M49427</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-03-17T19:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: advantage of DO UNTIL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/advantage-of-DO-UNTIL/m-p/257440#M49429</link>
      <description>&lt;P&gt;One generic "difference" is along the lines of "test at the top" and "test at the bottom". "Do While" means the intial value usually is set before the loop and often executes at least once because of the initial value. "Do until" is more often used to check the condition at the end of one execution fo the loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or treat as "do until this condition that is initially true is no longer true" and "Do until this condtion that is initially false is&amp;nbsp;true"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Usually with work one can get the same results with either loop construct.&lt;/P&gt;
&lt;P&gt;Be very leery of using Do Until or Do While with non-integer numerics and and Equal comparison especially if calculating the loop control as you might not get "equality" do to a variety of reasons with the sneakiest being precision issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider this program:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   x=0;
   do until(x=1);
      x=x+0.01;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Do not run this if you do not know how to interrupt a program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 20:04:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/advantage-of-DO-UNTIL/m-p/257440#M49429</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-03-17T20:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: advantage of DO UNTIL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/advantage-of-DO-UNTIL/m-p/257616#M49464</link>
      <description>@ LinusH. I believe looping is very important part of any programming language. I really want to master on it.</description>
      <pubDate>Fri, 18 Mar 2016 13:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/advantage-of-DO-UNTIL/m-p/257616#M49464</guid>
      <dc:creator>SAS_inquisitive</dc:creator>
      <dc:date>2016-03-18T13:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: advantage of DO UNTIL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/advantage-of-DO-UNTIL/m-p/257703#M49504</link>
      <description>&lt;P&gt;getting straight on where the exit test happens is an important aspect of understanding&lt;/P&gt;&lt;P&gt;the difference between while (at top) and until (at bottom).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are two other important loop constructs:&lt;/P&gt;&lt;P&gt;continue&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;leave&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;both of which can be implemented in macro loops as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check my paper for details&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Do_which_loop_while_or_until" target="_blank"&gt;http://www.sascommunity.org/wiki/Do_which_loop_while_or_until&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ron Fehd&amp;nbsp; loops maven&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2016 21:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/advantage-of-DO-UNTIL/m-p/257703#M49504</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2016-03-18T21:07:29Z</dc:date>
    </item>
  </channel>
</rss>

