<?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: Removing dups in a data/set step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Removing-dups-in-a-data-set-step/m-p/277386#M55685</link>
    <description>&lt;P&gt;In general you will need an additional step, such as proc sort with nodupkey option. But if both of your incoming data are presorted by the keys, you may rub in dedup process in one data step as such:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data h1;
input a b;
cards;
1 11 
1 22 
2 12 
;

data h2;
input a b;
cards;
1 11 
2 16 
;

data want;
set h1 h2;
by a b;
if first.b;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 14 Jun 2016 21:03:09 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2016-06-14T21:03:09Z</dc:date>
    <item>
      <title>Removing dups in a data/set step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-dups-in-a-data-set-step/m-p/277380#M55683</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I Know that a 'data/set' step work similar a 'union all' in proc sql&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data taball;&lt;/P&gt;
&lt;P&gt;set tab1 tab2;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there are dups rows in tab1 + tab2, rows that exits in both tables.., is there anyway yo remove dups in the data step?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something similar to 'union' in proc sql&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 20:50:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-dups-in-a-data-set-step/m-p/277380#M55683</guid>
      <dc:creator>juanvg1972</dc:creator>
      <dc:date>2016-06-14T20:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Removing dups in a data/set step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Removing-dups-in-a-data-set-step/m-p/277386#M55685</link>
      <description>&lt;P&gt;In general you will need an additional step, such as proc sort with nodupkey option. But if both of your incoming data are presorted by the keys, you may rub in dedup process in one data step as such:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data h1;
input a b;
cards;
1 11 
1 22 
2 12 
;

data h2;
input a b;
cards;
1 11 
2 16 
;

data want;
set h1 h2;
by a b;
if first.b;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jun 2016 21:03:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Removing-dups-in-a-data-set-step/m-p/277386#M55685</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2016-06-14T21:03:09Z</dc:date>
    </item>
  </channel>
</rss>

