<?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: why i cannot get rid of the second or third records of the same person in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/why-i-cannot-get-rid-of-the-second-or-third-records-of-the-same/m-p/277257#M55649</link>
    <description>&lt;P&gt;You haven't shown your data, but I assume from the code that each row of data has a different value in DATE variable. &amp;nbsp;Therefore when:&lt;/P&gt;
&lt;P&gt;if first.date&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is evaluated every row is different. &amp;nbsp;Do you not have a visit variable, i.e. VISIT 1, VISIT 2 etc. you could use that. &amp;nbsp;Or if the DATE variable is actually a datetime then use datepart() function to use only the date. &amp;nbsp;Without further information on your data I can't say.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jun 2016 14:51:48 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-06-14T14:51:48Z</dc:date>
    <item>
      <title>why i cannot get rid of the second or third records of the same person</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-i-cannot-get-rid-of-the-second-or-third-records-of-the-same/m-p/277251#M55646</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;ab2 dup;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; ab1;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; id date;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; first.date &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; ab2;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;else&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; dup;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;A patient has multiple visits and I only need to see the first vist. But with the above code, I cannot find any duplicate records. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;ANy advice how to remove the same ID with later visits, that might be second, third or even more visits?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;Thanks.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 14:44:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-i-cannot-get-rid-of-the-second-or-third-records-of-the-same/m-p/277251#M55646</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-06-14T14:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: why i cannot get rid of the second or third records of the same person</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-i-cannot-get-rid-of-the-second-or-third-records-of-the-same/m-p/277257#M55649</link>
      <description>&lt;P&gt;You haven't shown your data, but I assume from the code that each row of data has a different value in DATE variable. &amp;nbsp;Therefore when:&lt;/P&gt;
&lt;P&gt;if first.date&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is evaluated every row is different. &amp;nbsp;Do you not have a visit variable, i.e. VISIT 1, VISIT 2 etc. you could use that. &amp;nbsp;Or if the DATE variable is actually a datetime then use datepart() function to use only the date. &amp;nbsp;Without further information on your data I can't say.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 14:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-i-cannot-get-rid-of-the-second-or-third-records-of-the-same/m-p/277257#M55649</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-06-14T14:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: why i cannot get rid of the second or third records of the same person</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-i-cannot-get-rid-of-the-second-or-third-records-of-the-same/m-p/277262#M55651</link>
      <description>&lt;P&gt;If you want one per ID then use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if first.id then output ab2;&lt;/P&gt;
&lt;P&gt;else output dup;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 14:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-i-cannot-get-rid-of-the-second-or-third-records-of-the-same/m-p/277262#M55651</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-06-14T14:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: why i cannot get rid of the second or third records of the same person</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-i-cannot-get-rid-of-the-second-or-third-records-of-the-same/m-p/277263#M55652</link>
      <description>&lt;P&gt;yes each row of data has a different value in date variable&lt;/P&gt;&lt;P&gt;I do not have a visit variable, and date variable is a datetime,&lt;/P&gt;&lt;P&gt;can you provide a sas sample code as how to use datepart( )?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 14:59:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-i-cannot-get-rid-of-the-second-or-third-records-of-the-same/m-p/277263#M55652</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-06-14T14:59:04Z</dc:date>
    </item>
  </channel>
</rss>

