<?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: Identifying same observations in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799112#M33124</link>
    <description>&lt;PRE&gt;data have1;
 set sashelp.class;
run;

data have2;
 set sashelp.class end=last;
 output;
 if last then do;name='xxxx';output;end;
run;


proc sql;
create table obs_in_both as 
select * from have1
intersect
select * from have2
;
quit;&lt;/PRE&gt;</description>
    <pubDate>Mon, 28 Feb 2022 11:43:12 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2022-02-28T11:43:12Z</dc:date>
    <item>
      <title>Identifying same observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799039#M33117</link>
      <description>&lt;P&gt;I have two data sets with the same variables, but different observations. I need to know if any observations in data set 1 are in data set 2. How do I do this? Do I merge them first?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 00:54:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799039#M33117</guid>
      <dc:creator>CatPaws</dc:creator>
      <dc:date>2022-02-28T00:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying same observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799046#M33118</link>
      <description>&lt;P&gt;A few details would be helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could data set 1 contain two identical observations?&amp;nbsp; How would you like to handle that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you need to identify observations that are 100% identical, or just largely identical?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 02:08:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799046#M33118</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2022-02-28T02:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying same observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799082#M33120</link>
      <description>Data set 1 would not have identical observations within the dataset. I need to identify obervations that are 100% identical between data sets. For example, I need to know if there is an oberservation in data set 1 that is also in data set 2 or vice versa.</description>
      <pubDate>Mon, 28 Feb 2022 05:51:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799082#M33120</guid>
      <dc:creator>CatPaws</dc:creator>
      <dc:date>2022-02-28T05:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying same observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799093#M33121</link>
      <description>&lt;P&gt;PROC COMPARE is one option.&lt;/P&gt;
&lt;P&gt;Another option is to put your full observation in one varible - and convert it to a hash, using MD5 or SHA.&lt;/P&gt;
&lt;P&gt;Based on that you can use either data step merge or SQL inner join.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 08:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799093#M33121</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2022-02-28T08:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying same observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799112#M33124</link>
      <description>&lt;PRE&gt;data have1;
 set sashelp.class;
run;

data have2;
 set sashelp.class end=last;
 output;
 if last then do;name='xxxx';output;end;
run;


proc sql;
create table obs_in_both as 
select * from have1
intersect
select * from have2
;
quit;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Feb 2022 11:43:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799112#M33124</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-02-28T11:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying same observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799505#M33170</link>
      <description>&lt;P&gt;This will output all observations in B that match any observation in A, which satisfies your criterion as long as neither dataset has duplicates, and A and B have the same variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a b;
  set sashelp.class;
  if mod(_n_,3)=0 then output a b;
  else if mod(_n_,3)=1 then output a;
  else output b;
run;

data both;
  set b;
  if _n_=1 then do;
    declare hash ha (dataset:'a');
      ha.definekey(all:'Y');
      ha.definedone();
  end;
  if ha.find()=0;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Mar 2022 05:11:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799505#M33170</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2022-03-02T05:11:04Z</dc:date>
    </item>
  </channel>
</rss>

