<?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: Not common ids in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Not-common-ids/m-p/47004#M9707</link>
    <description>Thanks Ieva</description>
    <pubDate>Wed, 08 Dec 2010 19:28:54 GMT</pubDate>
    <dc:creator>SASPhile</dc:creator>
    <dc:date>2010-12-08T19:28:54Z</dc:date>
    <item>
      <title>Not common ids</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-common-ids/m-p/47000#M9703</link>
      <description>Two datasets A and B have Id's.How to find the id's that are NOT matching between them.&lt;BR /&gt;
&lt;BR /&gt;
I could use a merge:&lt;BR /&gt;
if   A and NOT B  then Output A1;&lt;BR /&gt;
if  NOT A and  B then output B1;&lt;BR /&gt;
&lt;BR /&gt;
Then combine A1 and B1 and get distinct  ids.&lt;BR /&gt;
Is there any other way?</description>
      <pubDate>Wed, 08 Dec 2010 14:33:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-common-ids/m-p/47000#M9703</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-12-08T14:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Not common ids</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-common-ids/m-p/47001#M9704</link>
      <description>You can also simply combile both of thes IF statements in one, so no need to merge afterwards:&lt;BR /&gt;
&lt;BR /&gt;
if (a and not b) or ( b and not a);</description>
      <pubDate>Wed, 08 Dec 2010 14:52:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-common-ids/m-p/47001#M9704</guid>
      <dc:creator>ieva</dc:creator>
      <dc:date>2010-12-08T14:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Not common ids</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-common-ids/m-p/47002#M9705</link>
      <description>Hello SASPhile,&lt;BR /&gt;
&lt;BR /&gt;
You can use even more simple logic: if NOT (a and b); like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data a;&lt;BR /&gt;
  x=1; output;&lt;BR /&gt;
  x=2; output;&lt;BR /&gt;
run;&lt;BR /&gt;
data b;&lt;BR /&gt;
  x=3; output;&lt;BR /&gt;
  x=2; output;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=a;&lt;BR /&gt;
  by x;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=b;&lt;BR /&gt;
  by x;&lt;BR /&gt;
run;&lt;BR /&gt;
data dif;&lt;BR /&gt;
  merge a (in=a) b(in=b);&lt;BR /&gt;
  if not (a and b); &lt;BR /&gt;
  by x;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Wed, 08 Dec 2010 19:12:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-common-ids/m-p/47002#M9705</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2010-12-08T19:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Not common ids</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-common-ids/m-p/47003#M9706</link>
      <description>Thanks SPR!</description>
      <pubDate>Wed, 08 Dec 2010 19:28:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-common-ids/m-p/47003#M9706</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-12-08T19:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Not common ids</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-common-ids/m-p/47004#M9707</link>
      <description>Thanks Ieva</description>
      <pubDate>Wed, 08 Dec 2010 19:28:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-common-ids/m-p/47004#M9707</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-12-08T19:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Not common ids</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-common-ids/m-p/47005#M9708</link>
      <description>Yes.&lt;BR /&gt;
There is another way.Try to use proc sql + except .&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data temp;&lt;BR /&gt;
 set sashelp.class;&lt;BR /&gt;
 where sex eq 'F';&lt;BR /&gt;
run;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
 select *&lt;BR /&gt;
  from sashelp.class as a&lt;BR /&gt;
   where a.sex not in (&lt;BR /&gt;
                        select b.sex&lt;BR /&gt;
						 from temp as b&lt;BR /&gt;
					   ) ;quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
But it is low efficient for the sub-query.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp

Message was edited by: Ksharp</description>
      <pubDate>Fri, 10 Dec 2010 07:46:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-common-ids/m-p/47005#M9708</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-12-10T07:46:19Z</dc:date>
    </item>
  </channel>
</rss>

