<?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 report number of abservation before and after removing the duplicates in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/report-number-of-abservation-before-and-after-removing-the/m-p/696642#M25291</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a dataset which has duplicates and I will be removing the duplicates and want to report the record of the observations before and after removing the duplicates.&lt;/P&gt;&lt;P&gt;Is there a code which I can do all together(before and after duplicates)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you in advance.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Nov 2020 18:59:30 GMT</pubDate>
    <dc:creator>Smitha9</dc:creator>
    <dc:date>2020-11-04T18:59:30Z</dc:date>
    <item>
      <title>report number of abservation before and after removing the duplicates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/report-number-of-abservation-before-and-after-removing-the/m-p/696642#M25291</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a dataset which has duplicates and I will be removing the duplicates and want to report the record of the observations before and after removing the duplicates.&lt;/P&gt;&lt;P&gt;Is there a code which I can do all together(before and after duplicates)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 18:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/report-number-of-abservation-before-and-after-removing-the/m-p/696642#M25291</guid>
      <dc:creator>Smitha9</dc:creator>
      <dc:date>2020-11-04T18:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: report number of abservation before and after removing the duplicates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/report-number-of-abservation-before-and-after-removing-the/m-p/696646#M25293</link>
      <description>&lt;P&gt;What do you want to do with those numbers? Proc Sort Nodupkey puts them in the log ?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 19:15:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/report-number-of-abservation-before-and-after-removing-the/m-p/696646#M25293</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-04T19:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: report number of abservation before and after removing the duplicates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/report-number-of-abservation-before-and-after-removing-the/m-p/698012#M25474</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So you can use the NODUPKEY option to remove the duplicate observations by using a BY statement with the keyword _ALL_. You can then also use the DUPOUT= option to then capture those removed observations so you can report the before and after. The following method also does not overwrite the original dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SORT&lt;/P&gt;&lt;P&gt;DATA = *original dataset*&lt;/P&gt;&lt;P&gt;NODUPKEY&lt;/P&gt;&lt;P&gt;OUT = *new dataset with removed duplications*&lt;/P&gt;&lt;P&gt;DUPOUT = *new dataset with removed observations*&lt;/P&gt;&lt;P&gt;BY _ALL_;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mady&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 21:26:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/report-number-of-abservation-before-and-after-removing-the/m-p/698012#M25474</guid>
      <dc:creator>mady3</dc:creator>
      <dc:date>2020-11-10T21:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: report number of abservation before and after removing the duplicates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/report-number-of-abservation-before-and-after-removing-the/m-p/698069#M25477</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=old out=new nodupkey;
  by key1 key2 key3;
run;

data _null_;
  if 0 then set old  nobs=n_old;
  if 0 then set new nobs=n_new;
  put  (n_:) (=);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The "if 0" conditions mean the corresponding then clauses are never executed, but the SAS complier nevertheless populates the n_old and n_new metadata values prior to execution stage.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 04:35:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/report-number-of-abservation-before-and-after-removing-the/m-p/698069#M25477</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-11-11T04:35:50Z</dc:date>
    </item>
  </channel>
</rss>

