<?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 What is the running mechanism when using a DOW Loop? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-running-mechanism-when-using-a-DOW-Loop/m-p/973822#M377745</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp; for inspiring me.&lt;/P&gt;
&lt;P&gt;When using DOW-Loop, I used to not writing a "stop" statement, but today I see difference from this post:&lt;A href="https://communities.sas.com/t5/SAS-Programming/Why-read-data-1-times-or-2-times-when-declare-hash-object-with/td-p/973810" target="_blank"&gt;Why read data 1 times or 2 times when declare hash object with or with... - SAS Support Communities&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DOW-Loop with "put _n_=" above:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  put _n_=;
  do until(_eof_);
    set sashelp.class end=_eof_;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS Log:&lt;/P&gt;
&lt;PRE&gt;_N_=1
_N_=2
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DOW-Loop with "put _n_=" above and "stop" behind:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  put _n_=;
  do until(_eof_);
    set sashelp.class end=_eof_;
  end;
  stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS Log:&lt;/P&gt;
&lt;PRE&gt;_N_=1&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DOW-Loop with "put _n_=" behind:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  do until(_eof_);
    set sashelp.class end=_eof_;
  end;
  put _n_=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS Log:&lt;/P&gt;
&lt;PRE&gt;_N_=1&lt;/PRE&gt;
&lt;P&gt;I have read&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/The-SAS-Supervisor/ta-p/429216" target="_blank"&gt;The SAS Supervisor - SAS Support Communities&lt;/A&gt;&amp;nbsp;and still not figure it out.&lt;/P&gt;</description>
    <pubDate>Mon, 01 Sep 2025 09:34:02 GMT</pubDate>
    <dc:creator>whymath</dc:creator>
    <dc:date>2025-09-01T09:34:02Z</dc:date>
    <item>
      <title>What is the running mechanism when using a DOW Loop?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-running-mechanism-when-using-a-DOW-Loop/m-p/973822#M377745</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp; for inspiring me.&lt;/P&gt;
&lt;P&gt;When using DOW-Loop, I used to not writing a "stop" statement, but today I see difference from this post:&lt;A href="https://communities.sas.com/t5/SAS-Programming/Why-read-data-1-times-or-2-times-when-declare-hash-object-with/td-p/973810" target="_blank"&gt;Why read data 1 times or 2 times when declare hash object with or with... - SAS Support Communities&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DOW-Loop with "put _n_=" above:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  put _n_=;
  do until(_eof_);
    set sashelp.class end=_eof_;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS Log:&lt;/P&gt;
&lt;PRE&gt;_N_=1
_N_=2
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DOW-Loop with "put _n_=" above and "stop" behind:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  put _n_=;
  do until(_eof_);
    set sashelp.class end=_eof_;
  end;
  stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS Log:&lt;/P&gt;
&lt;PRE&gt;_N_=1&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DOW-Loop with "put _n_=" behind:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  do until(_eof_);
    set sashelp.class end=_eof_;
  end;
  put _n_=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS Log:&lt;/P&gt;
&lt;PRE&gt;_N_=1&lt;/PRE&gt;
&lt;P&gt;I have read&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/The-SAS-Supervisor/ta-p/429216" target="_blank"&gt;The SAS Supervisor - SAS Support Communities&lt;/A&gt;&amp;nbsp;and still not figure it out.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2025 09:34:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-running-mechanism-when-using-a-DOW-Loop/m-p/973822#M377745</guid>
      <dc:creator>whymath</dc:creator>
      <dc:date>2025-09-01T09:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: What is the running mechanism when using a DOW Loop?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-running-mechanism-when-using-a-DOW-Loop/m-p/973835#M377748</link>
      <description>&lt;P&gt;DO UNTIL forces at least one iteration.&lt;/P&gt;
&lt;P&gt;So your step does this:&lt;/P&gt;
&lt;P&gt;In the first iteration of the DATA step (_N_ = 1), it works through the dataset until the last observation is read and _eof_ is set.&lt;/P&gt;
&lt;P&gt;Then it goes to the next DATA step iteration (_N_ = 2), performs the first iteration of the DO where the SET statement tries to read past the last observation, so the DATA step is terminated&amp;nbsp;&lt;EM&gt;immediately.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2025 10:23:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-running-mechanism-when-using-a-DOW-Loop/m-p/973835#M377748</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-09-01T10:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: What is the running mechanism when using a DOW Loop?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-running-mechanism-when-using-a-DOW-Loop/m-p/973837#M377749</link>
      <description>&lt;P&gt;I highly recommend reading:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://analytics.ncsu.edu/sesug/2002/TU05.pdf" target="_blank"&gt;https://analytics.ncsu.edu/sesug/2002/TU05.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings09/038-2009.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings09/038-2009.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2025 12:22:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-running-mechanism-when-using-a-DOW-Loop/m-p/973837#M377749</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2025-09-01T12:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: What is the running mechanism when using a DOW Loop?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-running-mechanism-when-using-a-DOW-Loop/m-p/973838#M377750</link>
      <description>&lt;P&gt;For further clarification: the END= variable is set&amp;nbsp;&lt;EM&gt;when the last observation is read&lt;/EM&gt;, but the termination of the DATA step happens when a&amp;nbsp;&lt;EM&gt;read&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;past the last observation&lt;/EM&gt; is attempted.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2025 12:34:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-running-mechanism-when-using-a-DOW-Loop/m-p/973838#M377750</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-09-01T12:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: What is the running mechanism when using a DOW Loop?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-running-mechanism-when-using-a-DOW-Loop/m-p/973843#M377752</link>
      <description>&lt;P&gt;Data steps that have input stop when a statement tries to read past its input.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In these examples that is the SET statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the same thing applies to data steps that use an INPUT statements to read in data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2025 14:42:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-running-mechanism-when-using-a-DOW-Loop/m-p/973843#M377752</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-09-01T14:42:01Z</dc:date>
    </item>
  </channel>
</rss>

