<?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 loop in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/do-loop/m-p/473423#M121490</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. total number of loops processed = stopvalue1*stopvalue2*&lt;STRONG&gt;stopvalueN&lt;/STRONG&gt;= 5*12=60&amp;nbsp; in your case&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/214904"&gt;@sanyam13&lt;/a&gt;: It goes without saying that "stop value" in the above calculation does not always equal the value following the TO keyword (such as &lt;FONT face="courier new,courier"&gt;10&lt;/FONT&gt; in &lt;FONT face="courier new,courier"&gt;do i=1 to 10&lt;/FONT&gt;), but can differ from that value in many ways depending on start value (&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;do i=0 to 10&lt;/FONT&gt;), increment (&lt;FONT face="courier new,courier"&gt;do i=1 to 10 by 2&lt;/FONT&gt;), WHILE/UNTIL conditions, the code performed in the loop (e.g. LEAVE statement), etc.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jun 2018 15:03:17 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2018-06-26T15:03:17Z</dc:date>
    <item>
      <title>do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop/m-p/473392#M121471</link>
      <description>&lt;P&gt;data test;&lt;BR /&gt;do year = 1 to 5;&lt;BR /&gt;do month = 1 to 12;&lt;BR /&gt;x+1;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can somebody explain how this nested loop works , how I m getting 60 observations&amp;nbsp; in output ?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 13:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop/m-p/473392#M121471</guid>
      <dc:creator>sanyam13</dc:creator>
      <dc:date>2018-06-26T13:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop/m-p/473393#M121472</link>
      <description>&lt;P&gt;see the below link, it clearly explains about nesting loops.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://onlinecourses.science.psu.edu/stat481/node/42/" target="_blank"&gt;https://onlinecourses.science.psu.edu/stat481/node/42/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 14:00:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop/m-p/473393#M121472</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-06-26T14:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop/m-p/473396#M121474</link>
      <description>&lt;P&gt;Break it down:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;do year = 1 to 5;&amp;nbsp; &amp;nbsp;&amp;lt; - do this code 5 times&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;do month = 1 to 12;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;x+1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; output;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; end;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;end;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;For each of those five times:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;do month = 1 to 12;&amp;nbsp; &amp;lt;- do this code 12 times&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;x+1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; output;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thus you are running 12 times&amp;nbsp;(inner loop) for each of the 5 times (outer loop) = 60 iterations.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 14:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop/m-p/473396#M121474</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-26T14:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop/m-p/473400#M121478</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/214904"&gt;@sanyam13&lt;/a&gt;&amp;nbsp; A quick way to grasp the way my professor taught me a loop construct in any programming language&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. inner most look executes in full and followed by one&amp;nbsp; by one to reverse top order&lt;/P&gt;&lt;P&gt;2. total number of loops processed = stopvalue1*stopvalue2*&lt;STRONG&gt;stopvalueN&lt;/STRONG&gt;= 5*12=60&amp;nbsp; in your case&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 14:24:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop/m-p/473400#M121478</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-06-26T14:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop/m-p/473423#M121490</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. total number of loops processed = stopvalue1*stopvalue2*&lt;STRONG&gt;stopvalueN&lt;/STRONG&gt;= 5*12=60&amp;nbsp; in your case&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/214904"&gt;@sanyam13&lt;/a&gt;: It goes without saying that "stop value" in the above calculation does not always equal the value following the TO keyword (such as &lt;FONT face="courier new,courier"&gt;10&lt;/FONT&gt; in &lt;FONT face="courier new,courier"&gt;do i=1 to 10&lt;/FONT&gt;), but can differ from that value in many ways depending on start value (&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;do i=0 to 10&lt;/FONT&gt;), increment (&lt;FONT face="courier new,courier"&gt;do i=1 to 10 by 2&lt;/FONT&gt;), WHILE/UNTIL conditions, the code performed in the loop (e.g. LEAVE statement), etc.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 15:03:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop/m-p/473423#M121490</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-06-26T15:03:17Z</dc:date>
    </item>
  </channel>
</rss>

