<?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: Finding redundant entries for same ID and date in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Finding-redundant-entries-for-same-ID-and-date/m-p/249412#M6641</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have out=havesorted;
by id visitdate;
run;
data want ;
set havesorted ;
by id visitdate;
if not (first.visitdate and last.visitdate) then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 11 Feb 2016 10:56:04 GMT</pubDate>
    <dc:creator>mohamed_zaki</dc:creator>
    <dc:date>2016-02-11T10:56:04Z</dc:date>
    <item>
      <title>Finding redundant entries for same ID and date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Finding-redundant-entries-for-same-ID-and-date/m-p/249399#M6639</link>
      <description>&lt;P&gt;Hi there,I have longitudinal data in long format. each individual (part of a couple) is supposed to have a single row per visit. there are some, like below, that have 2 entries for an individual on the same date. I need to find out which IDs and for which visitdates there are multiple rows/entries. Help? Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.TV" frame="box" rules="all" cellpadding="5" cellspacing="0"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;id&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;htid&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;womanage&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;manage&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;cjbase&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;visitdate&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;linked&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;inflam_3mo_female&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1244&lt;/TH&gt;
&lt;TD class="l data"&gt;5538M&lt;/TD&gt;
&lt;TD class="r data"&gt;5538&lt;/TD&gt;
&lt;TD class="r data"&gt;22&lt;/TD&gt;
&lt;TD class="r data"&gt;35&lt;/TD&gt;
&lt;TD class="l data"&gt;+-&lt;/TD&gt;
&lt;TD class="r data"&gt;05NOV2003&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1245&lt;/TH&gt;
&lt;TD class="l data"&gt;5538F&lt;/TD&gt;
&lt;TD class="r data"&gt;5538&lt;/TD&gt;
&lt;TD class="r data"&gt;22&lt;/TD&gt;
&lt;TD class="r data"&gt;35&lt;/TD&gt;
&lt;TD class="l data"&gt;+-&lt;/TD&gt;
&lt;TD class="r data"&gt;05NOV2003&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1246&lt;/TH&gt;
&lt;TD class="l data"&gt;5538F&lt;/TD&gt;
&lt;TD class="r data"&gt;5538&lt;/TD&gt;
&lt;TD class="r data"&gt;22&lt;/TD&gt;
&lt;TD class="r data"&gt;35&lt;/TD&gt;
&lt;TD class="l data"&gt;+-&lt;/TD&gt;
&lt;TD class="r data"&gt;05NOV2003&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Thu, 11 Feb 2016 09:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Finding-redundant-entries-for-same-ID-and-date/m-p/249399#M6639</guid>
      <dc:creator>mcdj</dc:creator>
      <dc:date>2016-02-11T09:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Finding redundant entries for same ID and date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Finding-redundant-entries-for-same-ID-and-date/m-p/249412#M6641</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have out=havesorted;
by id visitdate;
run;
data want ;
set havesorted ;
by id visitdate;
if not (first.visitdate and last.visitdate) then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Feb 2016 10:56:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Finding-redundant-entries-for-same-ID-and-date/m-p/249412#M6641</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-02-11T10:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Finding redundant entries for same ID and date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Finding-redundant-entries-for-same-ID-and-date/m-p/249423#M6642</link>
      <description>&lt;P&gt;If you wish to output&amp;nbsp;all observations in a duplicate situation, you can use SQL as well (untested):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table want as
      select *
      from have
      group by id, visitdate
      having count(*) &amp;gt; 1
   ;
quit,&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you just wish to output the duplicate observation(s), use proc sort with the dupout= option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 11:42:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Finding-redundant-entries-for-same-ID-and-date/m-p/249423#M6642</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-11T11:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Finding redundant entries for same ID and date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Finding-redundant-entries-for-same-ID-and-date/m-p/249442#M6647</link>
      <description>&lt;P&gt;And yet another possibility&lt;/P&gt;
&lt;P&gt;proc freq data=have noprint;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; tables Id*visitdate/list out=dups (where=(count&amp;gt;1));&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 13:48:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Finding-redundant-entries-for-same-ID-and-date/m-p/249442#M6647</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-02-11T13:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Finding redundant entries for same ID and date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Finding-redundant-entries-for-same-ID-and-date/m-p/249523#M6654</link>
      <description>&lt;P&gt;thanks, worked perfectly!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 19:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Finding-redundant-entries-for-same-ID-and-date/m-p/249523#M6654</guid>
      <dc:creator>mcdj</dc:creator>
      <dc:date>2016-02-11T19:50:19Z</dc:date>
    </item>
  </channel>
</rss>

