<?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: proc sort data - dupout nodupkey issue in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sort-data-dupout-nodupkey-issue/m-p/353777#M23327</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this, to view the total occurrences for each permutation of your variables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL; 
CREATE TABLE TOTALOCCURRENCE AS
SELECT IDINTERNAL, CUSTOMERNUMBER, IDOCCURRENCE, COUNT(*) AS TOTAL FROM ACCS GROUP BY IDINTERNAL, CUSTOMERNUMBER, IDOCCURRENCE;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then, after viewing, if you would like a dataset of distinct occurrences, you could write:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CREATE TABLE ALLDISTINCT AS
SELECT DISTINCT IDINTERNAL, CUSTOMERNUMBER, IDOCCURRENCE FROM ACCS;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 26 Apr 2017 16:16:50 GMT</pubDate>
    <dc:creator>thomp7050</dc:creator>
    <dc:date>2017-04-26T16:16:50Z</dc:date>
    <item>
      <title>proc sort data - dupout nodupkey issue</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sort-data-dupout-nodupkey-issue/m-p/353770#M23326</link>
      <description>&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've merged two datasets and have some reason duplicates corrected within it. I would like to know where these duplicates exist. Thus I've used the following piece of code;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=accs dupout=dups nodupkey out=correct; by idinternal customernumber idoccurrence;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the accs dataset I've 315,050 observations and in the correct dataset I've 312,326. However, the dups dataset is empty.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it would appear that I've circa 2,700 duplicate observations but they are no where to be seen?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could somone shed some light on the this issue, please?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 15:53:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sort-data-dupout-nodupkey-issue/m-p/353770#M23326</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2017-04-26T15:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: proc sort data - dupout nodupkey issue</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sort-data-dupout-nodupkey-issue/m-p/353777#M23327</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this, to view the total occurrences for each permutation of your variables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL; 
CREATE TABLE TOTALOCCURRENCE AS
SELECT IDINTERNAL, CUSTOMERNUMBER, IDOCCURRENCE, COUNT(*) AS TOTAL FROM ACCS GROUP BY IDINTERNAL, CUSTOMERNUMBER, IDOCCURRENCE;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then, after viewing, if you would like a dataset of distinct occurrences, you could write:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CREATE TABLE ALLDISTINCT AS
SELECT DISTINCT IDINTERNAL, CUSTOMERNUMBER, IDOCCURRENCE FROM ACCS;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Apr 2017 16:16:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sort-data-dupout-nodupkey-issue/m-p/353777#M23327</guid>
      <dc:creator>thomp7050</dc:creator>
      <dc:date>2017-04-26T16:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: proc sort data - dupout nodupkey issue</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sort-data-dupout-nodupkey-issue/m-p/353779#M23328</link>
      <description>&lt;P&gt;It looks like NODUPKEY is kicking in, removing duplicates before the DUPOUT= option can examine.&amp;nbsp; Try removing NODUPKEY and see if that resolves the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 16:19:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-sort-data-dupout-nodupkey-issue/m-p/353779#M23328</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-26T16:19:30Z</dc:date>
    </item>
  </channel>
</rss>

