<?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 sql exception intesection in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679365#M79436</link>
    <description>&lt;P&gt;These two datasets show the effect of duplicates:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data first;
input a $ b;
datalines;
a 1
a 1
b 2
c 3
;

data second;
input a $ b;
datalines;
d 4
d 4
e 5
e 5
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 26 Aug 2020 07:10:29 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-08-26T07:10:29Z</dc:date>
    <item>
      <title>proc sql exception intesection</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679057#M79421</link>
      <description>&lt;PRE&gt;PROC SQL;
CREATE TABLE onlyfrist AS
SELECT * FROM first
EXCEPT
SELECT * FROM second;
quit;

PROC SQL;
CREATE TABLE onlysecond AS
SELECT * FROM second
EXCEPT
SELECT * FROM first ;
quit;

PROC SQL;
CREATE TABLE firstAndsecond AS
SELECT * FROM first
intersect
SELECT * FROM second;
quit;
&lt;/PRE&gt;
&lt;P&gt;my first and second contains 284 records each.&lt;/P&gt;
&lt;P&gt;onlyfirst--281&lt;/P&gt;
&lt;P&gt;intersect--0&lt;/P&gt;
&lt;P&gt;onlysecond--281.&amp;nbsp; How it is not able to understand. can somebody help me?&lt;/P&gt;
&lt;P&gt;Note:&amp;nbsp; first and second datasets all variables are same including length.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 04:59:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679057#M79421</guid>
      <dc:creator>rajeshm</dc:creator>
      <dc:date>2020-08-25T04:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql exception intesection</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679065#M79422</link>
      <description>&lt;P&gt;To explain this, we will need to see your data. Please attach the two data steps with datalines as a text file.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 05:54:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679065#M79422</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-25T05:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql exception intesection</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679126#M79423</link>
      <description>Your  first and second should contain duplicated obs .&lt;BR /&gt;using ALL to retain all the obs .&lt;BR /&gt;&lt;BR /&gt;SELECT * FROM first&lt;BR /&gt;intersect all&lt;BR /&gt;SELECT * FROM second;</description>
      <pubDate>Tue, 25 Aug 2020 11:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679126#M79423</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-08-25T11:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql exception intesection</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679338#M79434</link>
      <description>&lt;P&gt;Thanks for the reply. I can't copy my data here.if you think based on data it is possible to get this type of output,please&amp;nbsp; provide sample data to suit this output. Don't mind.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data set A=284 records&lt;/P&gt;
&lt;P&gt;data set B=284 records&lt;/P&gt;
&lt;P&gt;A Except B=281&lt;/P&gt;
&lt;P&gt;B Except A=281&lt;/P&gt;
&lt;P&gt;A intersect/intersect all B=0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 05:00:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679338#M79434</guid>
      <dc:creator>rajeshm</dc:creator>
      <dc:date>2020-08-26T05:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql exception intesection</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679339#M79435</link>
      <description>&lt;P&gt;thanks for the reply.&lt;/P&gt;
&lt;P&gt;if you think it is possible to get this type of output please provide sample data which can give this type of result.&lt;/P&gt;
&lt;P&gt;data set A=284 records&lt;/P&gt;
&lt;P&gt;data set B=284 records&lt;/P&gt;
&lt;P&gt;A Except B=281&lt;/P&gt;
&lt;P&gt;B Except A=281&lt;/P&gt;
&lt;P&gt;A intersect/intersect all B=0&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 05:00:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679339#M79435</guid>
      <dc:creator>rajeshm</dc:creator>
      <dc:date>2020-08-26T05:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql exception intesection</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679365#M79436</link>
      <description>&lt;P&gt;These two datasets show the effect of duplicates:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data first;
input a $ b;
datalines;
a 1
a 1
b 2
c 3
;

data second;
input a $ b;
datalines;
d 4
d 4
e 5
e 5
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Aug 2020 07:10:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679365#M79436</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-26T07:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql exception intesection</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679402#M79437</link>
      <description>SELECT * FROM first&lt;BR /&gt;EXCEPT ALL&lt;BR /&gt;SELECT * FROM second;</description>
      <pubDate>Wed, 26 Aug 2020 11:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679402#M79437</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-08-26T11:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql exception intesection</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679405#M79438</link>
      <description>&lt;P&gt;thanks for the reply boss.&lt;/P&gt;
&lt;P&gt;Earlier did not get your answer but now...understand your logic&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 12:03:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679405#M79438</guid>
      <dc:creator>rajeshm</dc:creator>
      <dc:date>2020-08-26T12:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql exception intesection</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679406#M79439</link>
      <description>&lt;P&gt;thanks for the reply boss.&lt;/P&gt;
&lt;P&gt;did not realize your logic ..but now fine.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 12:05:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-exception-intesection/m-p/679406#M79439</guid>
      <dc:creator>rajeshm</dc:creator>
      <dc:date>2020-08-26T12:05:03Z</dc:date>
    </item>
  </channel>
</rss>

