<?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: Selecting Records Based on Appearances in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Selecting-Records-Based-on-Appearances/m-p/667824#M200069</link>
    <description>Untested code:&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;  set have;&lt;BR /&gt;  by daily_grouping;&lt;BR /&gt;  if not first.daily_grouping;&lt;BR /&gt;run;</description>
    <pubDate>Wed, 08 Jul 2020 18:59:34 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2020-07-08T18:59:34Z</dc:date>
    <item>
      <title>Selecting Records Based on Appearances</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-Records-Based-on-Appearances/m-p/667817#M200065</link>
      <description>&lt;P&gt;This is a bit of a weird request....I have some data on aircraft flights that I need to break out depending on how many times they appear in a group. The group is identified as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;daily_grouping&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042452&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042452&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042452&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042452&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042452&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042452&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042453&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042454&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042455&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042455&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042456&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042456&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042456&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are other variables as well, but the daily_grouping is the one to key in on. Here is what I would like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. If a daily_grouping number appears only once, it should be removed.&lt;/P&gt;&lt;P&gt;2. If a daily_grouping number appears more than once, then the first instance should be removed and n-1 should remain.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This means that in the example above the result would be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;daily_grouping&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042452&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042452&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042452&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042452&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042452&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042455&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042456&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="3"&gt;104042456&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated! Not sure if multiple steps are needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 18:41:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-Records-Based-on-Appearances/m-p/667817#M200065</guid>
      <dc:creator>BCNAV</dc:creator>
      <dc:date>2020-07-08T18:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Records Based on Appearances</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-Records-Based-on-Appearances/m-p/667820#M200068</link>
      <description>&lt;PRE&gt;data have;
input daily_grouping :$10.;
datalines;
104042452
104042452
104042452
104042452
104042452
104042452
104042453
104042454
104042455
104042455
104042456
104042456
104042456
;

data want;
   set have;
   by daily_grouping;
   if not first.daily_grouping;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Jul 2020 18:56:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-Records-Based-on-Appearances/m-p/667820#M200068</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-08T18:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Records Based on Appearances</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-Records-Based-on-Appearances/m-p/667824#M200069</link>
      <description>Untested code:&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;  set have;&lt;BR /&gt;  by daily_grouping;&lt;BR /&gt;  if not first.daily_grouping;&lt;BR /&gt;run;</description>
      <pubDate>Wed, 08 Jul 2020 18:59:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-Records-Based-on-Appearances/m-p/667824#M200069</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-07-08T18:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Records Based on Appearances</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-Records-Based-on-Appearances/m-p/667878#M200090</link>
      <description>thanks all!</description>
      <pubDate>Wed, 08 Jul 2020 21:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-Records-Based-on-Appearances/m-p/667878#M200090</guid>
      <dc:creator>BCNAV</dc:creator>
      <dc:date>2020-07-08T21:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Records Based on Appearances</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-Records-Based-on-Appearances/m-p/668006#M200155</link>
      <description>&lt;PRE&gt;data have;
input daily_grouping :$10.;
datalines;
104042452
104042452
104042452
104042452
104042452
104042452
104042453
104042454
104042455
104042455
104042456
104042456
104042456
;

proc sort data=have dupout=want nodupkey;
by daily_grouping ;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Jul 2020 11:53:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-Records-Based-on-Appearances/m-p/668006#M200155</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-07-09T11:53:35Z</dc:date>
    </item>
  </channel>
</rss>

