<?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 Merge problem in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merge-problem/m-p/62502#M13621</link>
    <description>Hi All,&lt;BR /&gt;
&lt;BR /&gt;
I want to create a dataset with all rows from 'one' except rows from 'two'.i.e i don't want rows from 'two'.problem is that by variable has duplicates.&lt;BR /&gt;
&lt;BR /&gt;
I usually do like this,&lt;BR /&gt;
&lt;BR /&gt;
'one' and 'two' are sorted by 'connect' .&lt;BR /&gt;
&lt;BR /&gt;
data new;&lt;BR /&gt;
merge one(in=a)  two(in=b);&lt;BR /&gt;
by connect;&lt;BR /&gt;
if a=1 and b=0;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I am thinking that it will be done by using except operator in proc sql, Can any body give some idea on this?&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
    <pubDate>Thu, 20 Nov 2008 10:59:38 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-11-20T10:59:38Z</dc:date>
    <item>
      <title>Merge problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-problem/m-p/62502#M13621</link>
      <description>Hi All,&lt;BR /&gt;
&lt;BR /&gt;
I want to create a dataset with all rows from 'one' except rows from 'two'.i.e i don't want rows from 'two'.problem is that by variable has duplicates.&lt;BR /&gt;
&lt;BR /&gt;
I usually do like this,&lt;BR /&gt;
&lt;BR /&gt;
'one' and 'two' are sorted by 'connect' .&lt;BR /&gt;
&lt;BR /&gt;
data new;&lt;BR /&gt;
merge one(in=a)  two(in=b);&lt;BR /&gt;
by connect;&lt;BR /&gt;
if a=1 and b=0;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I am thinking that it will be done by using except operator in proc sql, Can any body give some idea on this?&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
      <pubDate>Thu, 20 Nov 2008 10:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-problem/m-p/62502#M13621</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-11-20T10:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Merge problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-problem/m-p/62503#M13622</link>
      <description>You could try:&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table new as&lt;BR /&gt;
select * from one where&lt;BR /&gt;
connect not in (select distinct connect from two);&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
This generates a sub query to find all the values of connect in two. The where clause will take only the records from one which do not have a value of connect that is in the list resulting from the sub query.&lt;BR /&gt;
&lt;BR /&gt;
Hope that's what you are after.</description>
      <pubDate>Thu, 20 Nov 2008 11:07:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-problem/m-p/62503#M13622</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-11-20T11:07:24Z</dc:date>
    </item>
  </channel>
</rss>

