<?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 need a help to read the table records with duplicates in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235464#M55079</link>
    <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;read the table if we have the duplicates it should write to the separate dataset and without duplicates to other dataset.please help&lt;/P&gt;</description>
    <pubDate>Thu, 19 Nov 2015 14:20:22 GMT</pubDate>
    <dc:creator>arunams30</dc:creator>
    <dc:date>2015-11-19T14:20:22Z</dc:date>
    <item>
      <title>need a help to read the table records with duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235464#M55079</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;read the table if we have the duplicates it should write to the separate dataset and without duplicates to other dataset.please help&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 14:20:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235464#M55079</guid>
      <dc:creator>arunams30</dc:creator>
      <dc:date>2015-11-19T14:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: need a help to read the table records with duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235466#M55080</link>
      <description>This can be done in lots of different ways ...Pls specify what you are looking for .</description>
      <pubDate>Thu, 19 Nov 2015 14:29:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235466#M55080</guid>
      <dc:creator>pearsoninst</dc:creator>
      <dc:date>2015-11-19T14:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: need a help to read the table records with duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235469#M55081</link>
      <description>&lt;P&gt;There's a few ways to do this, it's best to give an example of the data you have and what you want to see.&amp;nbsp; Here's one solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input variable;&lt;BR /&gt;cards;&lt;BR /&gt;1&lt;BR /&gt;1&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;5&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;data dup nodup;&lt;BR /&gt;do until(last.variable);&lt;BR /&gt;set have;&lt;BR /&gt;by variable;&lt;BR /&gt;count + 1;&lt;BR /&gt;if first.variable then count = 1;&lt;BR /&gt;if count &amp;gt; 1 then dup = 'Y';&lt;BR /&gt;end;&lt;BR /&gt;do until(last.variable);&lt;BR /&gt;set have;&lt;BR /&gt;by variable;&lt;BR /&gt;if dup = 'Y' then output dup;&lt;BR /&gt;else output nodup;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 14:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235469#M55081</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-11-19T14:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: need a help to read the table records with duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235471#M55082</link>
      <description>&lt;P&gt;Or, to save yourself all that typing, you could do:&lt;/P&gt;
&lt;P&gt;proc sort data=have out=uniques dupout=dups nodupkey;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; by &amp;lt;id variables&amp;gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And then if you want only those singles (as wasn't clear from the original post):&lt;/P&gt;
&lt;P&gt;proc sql;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; create table WANT as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; select * from UNIQUES&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; where &amp;lt;id variables&amp;gt; not in (select &amp;lt;id vars&amp;gt; from DUPS);&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 14:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235471#M55082</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-19T14:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: need a help to read the table records with duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235481#M55085</link>
      <description>&lt;P&gt;&lt;BR /&gt;It is easy to do with proc sort.&lt;/P&gt;&lt;P&gt;If you want to keep one record from duplicate records, you could use nodupkey,&lt;BR /&gt;out dataset is Non_dup,remaining duplicate records go to up.&lt;BR /&gt;If you want to keep all unique record, use nouniqueley,all records go to uniqueout, othwise go to out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input x $ y;&lt;BR /&gt;cards;&lt;BR /&gt;A 1&lt;BR /&gt;A 2&lt;BR /&gt;B 1&lt;BR /&gt;C 3&lt;BR /&gt;C 3&lt;BR /&gt;D 3&lt;BR /&gt;E 9&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sort data=have out=Non_dup dupout=dup nodupkey ;&lt;BR /&gt;by x;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sort data=have uniqueout=Unique out=all_dup nouniquekey;&lt;BR /&gt;by x;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 15:44:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235481#M55085</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2015-11-19T15:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: need a help to read the table records with duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235549#M55097</link>
      <description>&lt;P&gt;Here are the pieces that you didn't tell us:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(a) What constitutes a duplicate?&amp;nbsp; Is just one variable the same, or are all variables the same?&lt;/P&gt;
&lt;P&gt;(b) If there are duplicates, should all of them go into the same data set?&amp;nbsp; Or should the first one go into a separate data set and any additional duplicates go into a different data set?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2015 20:51:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235549#M55097</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-11-19T20:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: need a help to read the table records with duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235653#M55116</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The table has duplicates,from that table i have read the records,the records which have duplictes should go one dataset and the records without duplicates should go to other data set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 13:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235653#M55116</guid>
      <dc:creator>arunams30</dc:creator>
      <dc:date>2015-11-20T13:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: need a help to read the table records with duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235654#M55117</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;thanks for your reply.&lt;BR /&gt;&lt;BR /&gt;The table has duplicates,from that table i have read the records,the records which have duplictes should go one dataset and the records without duplicates should go to other data set.</description>
      <pubDate>Fri, 20 Nov 2015 13:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235654#M55117</guid>
      <dc:creator>arunams30</dc:creator>
      <dc:date>2015-11-20T13:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: need a help to read the table records with duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235656#M55118</link>
      <description>&lt;P&gt;In that case I think you want to use the solution I provided earlier.&amp;nbsp; Run that with a subset and see if you get the desired results.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 13:24:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-a-help-to-read-the-table-records-with-duplicates/m-p/235656#M55118</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-11-20T13:24:00Z</dc:date>
    </item>
  </channel>
</rss>

