<?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: SET statement in DO loop in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SET-statement-in-DO-loop/m-p/115669#M23819</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SET is an executable statement. So if you code it in a loop then it just reads one observation for each time it is called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have what has been termed a DOW loop.&amp;nbsp; See this earlier posting that has a link to an article on DOW loops.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="active_link" href="https://communities.sas.com/message/140387#140387" title="https://communities.sas.com/message/140387#140387"&gt;https://communities.sas.com/message/140387#140387&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Jan 2013 18:59:01 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2013-01-04T18:59:01Z</dc:date>
    <item>
      <title>SET statement in DO loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SET-statement-in-DO-loop/m-p/115668#M23818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I recently came across some SAS code that contained a SET statement inside a DO loop.&amp;nbsp; Can someone explain to me exactly how SAS is processing the data or any papers that might help.&amp;nbsp; I understand arrays and loops, i just have never seen the set statement inside a loop before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;DATA NEW (KEEP=NAME DATE1-DATE20);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;ARRAY DATES {20} DATE1-DATE20;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;OBSNO + 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;DO I=1 TO 20 UNTIL (LAST.NAME);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;SET OLD;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;BY NAME;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;IF FIRST.NAME THEN OBSNO=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;DATES{I} = DATE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 18:40:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SET-statement-in-DO-loop/m-p/115668#M23818</guid>
      <dc:creator>briani</dc:creator>
      <dc:date>2013-01-04T18:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: SET statement in DO loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SET-statement-in-DO-loop/m-p/115669#M23819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SET is an executable statement. So if you code it in a loop then it just reads one observation for each time it is called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have what has been termed a DOW loop.&amp;nbsp; See this earlier posting that has a link to an article on DOW loops.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="active_link" href="https://communities.sas.com/message/140387#140387" title="https://communities.sas.com/message/140387#140387"&gt;https://communities.sas.com/message/140387#140387&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 18:59:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SET-statement-in-DO-loop/m-p/115669#M23819</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-01-04T18:59:01Z</dc:date>
    </item>
  </channel>
</rss>

