<?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: dropping last observations in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/dropping-last-observations/m-p/485329#M126075</link>
    <description>&lt;P&gt;Drop the last observation? How?&lt;/P&gt;
&lt;P&gt;This:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(drop=count);
  set have;
  by permno descending date;
  if first.permno then count=0;
  count+1;
  if count&amp;gt;1;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is the same is that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  by permno descending date;
  if first.permno then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Aug 2018 01:55:07 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2018-08-09T01:55:07Z</dc:date>
    <item>
      <title>dropping last observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dropping-last-observations/m-p/485310#M126067</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to drop the last observations from my data set but want to keep them only if the date is 29dec2017. I am using the following code, although it works perfectly fine but I am just unsure how to incorporate the date clause in it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data want(drop=count);
  set have;
  by permno descending date;
  if first.permno then count=0;
  count+1;
  if count&amp;gt;1;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 23:45:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dropping-last-observations/m-p/485310#M126067</guid>
      <dc:creator>Amalik</dc:creator>
      <dc:date>2018-08-08T23:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: dropping last observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dropping-last-observations/m-p/485325#M126072</link>
      <description>&lt;P&gt;I added the code in CAPS below. Check the date first, then set count to zero if not that day.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(drop=count);
  set have;
  by permno descending date;
  IF DATE = "29DEC2017"d THEN COUNT=1;
  ELSE if first.permno then count=0;
  count+1;
  if count&amp;gt;1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Aug 2018 01:20:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dropping-last-observations/m-p/485325#M126072</guid>
      <dc:creator>cau83</dc:creator>
      <dc:date>2018-08-09T01:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: dropping last observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dropping-last-observations/m-p/485329#M126075</link>
      <description>&lt;P&gt;Drop the last observation? How?&lt;/P&gt;
&lt;P&gt;This:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(drop=count);
  set have;
  by permno descending date;
  if first.permno then count=0;
  count+1;
  if count&amp;gt;1;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is the same is that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  by permno descending date;
  if first.permno then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 01:55:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dropping-last-observations/m-p/485329#M126075</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-08-09T01:55:07Z</dc:date>
    </item>
  </channel>
</rss>

