<?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 if last.var then output in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/if-last-var-then-output/m-p/40317#M8191</link>
    <description>Why is this set of codes not working as expected [only last observation (highest or last staff value) selected]?  &lt;BR /&gt;
&lt;BR /&gt;
data testing;&lt;BR /&gt;
input id staff y$;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 1 M&lt;BR /&gt;
1 2 N&lt;BR /&gt;
1 3 O&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data =testing ;&lt;BR /&gt;
by   id staff;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data testing2;&lt;BR /&gt;
set testing ;&lt;BR /&gt;
by id staff;&lt;BR /&gt;
if last.staff then output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
    <pubDate>Wed, 20 Aug 2008 06:11:38 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-08-20T06:11:38Z</dc:date>
    <item>
      <title>if last.var then output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-last-var-then-output/m-p/40317#M8191</link>
      <description>Why is this set of codes not working as expected [only last observation (highest or last staff value) selected]?  &lt;BR /&gt;
&lt;BR /&gt;
data testing;&lt;BR /&gt;
input id staff y$;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 1 M&lt;BR /&gt;
1 2 N&lt;BR /&gt;
1 3 O&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data =testing ;&lt;BR /&gt;
by   id staff;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data testing2;&lt;BR /&gt;
set testing ;&lt;BR /&gt;
by id staff;&lt;BR /&gt;
if last.staff then output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Wed, 20 Aug 2008 06:11:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-last-var-then-output/m-p/40317#M8191</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-08-20T06:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: if last.var then output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-last-var-then-output/m-p/40318#M8192</link>
      <description>OK, I got it!!!</description>
      <pubDate>Wed, 20 Aug 2008 06:29:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-last-var-then-output/m-p/40318#M8192</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-08-20T06:29:20Z</dc:date>
    </item>
  </channel>
</rss>

