<?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 how to combine two dataset to read only observations that are in both data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-combine-two-dataset-to-read-only-observations-that-are-in/m-p/725049#M225166</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I have&amp;nbsp;two dataset similar to the examples below, i wanted to read only observations that are in both data.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Dataset one&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dataset two&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ID&amp;nbsp;&amp;nbsp; A&amp;nbsp;&amp;nbsp; B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ID&amp;nbsp;&amp;nbsp; A&amp;nbsp; B&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;10&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&amp;nbsp;&amp;nbsp; 0&amp;nbsp; 4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;20&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30&amp;nbsp;&amp;nbsp; 5&amp;nbsp; 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;30&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp; 6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;40&amp;nbsp;&amp;nbsp; 7&amp;nbsp; 3&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I want the output that looks like this&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ID&amp;nbsp;&amp;nbsp; A&amp;nbsp;&amp;nbsp; B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;10&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;10&amp;nbsp;&amp;nbsp; 0&amp;nbsp; 4 &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;30&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp; 6&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;30&amp;nbsp;&amp;nbsp; 5&amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Mar 2021 03:51:42 GMT</pubDate>
    <dc:creator>hjjijkkl</dc:creator>
    <dc:date>2021-03-10T03:51:42Z</dc:date>
    <item>
      <title>how to combine two dataset to read only observations that are in both data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-combine-two-dataset-to-read-only-observations-that-are-in/m-p/725049#M225166</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have&amp;nbsp;two dataset similar to the examples below, i wanted to read only observations that are in both data.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Dataset one&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dataset two&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ID&amp;nbsp;&amp;nbsp; A&amp;nbsp;&amp;nbsp; B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ID&amp;nbsp;&amp;nbsp; A&amp;nbsp; B&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;10&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&amp;nbsp;&amp;nbsp; 0&amp;nbsp; 4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;20&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30&amp;nbsp;&amp;nbsp; 5&amp;nbsp; 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;30&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp; 6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;40&amp;nbsp;&amp;nbsp; 7&amp;nbsp; 3&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I want the output that looks like this&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ID&amp;nbsp;&amp;nbsp; A&amp;nbsp;&amp;nbsp; B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;10&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;10&amp;nbsp;&amp;nbsp; 0&amp;nbsp; 4 &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;30&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp; 6&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;30&amp;nbsp;&amp;nbsp; 5&amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 03:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-combine-two-dataset-to-read-only-observations-that-are-in/m-p/725049#M225166</guid>
      <dc:creator>hjjijkkl</dc:creator>
      <dc:date>2021-03-10T03:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to combine two dataset to read only observations that are in both data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-combine-two-dataset-to-read-only-observations-that-are-in/m-p/725062#M225167</link>
      <description>&lt;P&gt;What have you tried?&lt;/P&gt;
&lt;P&gt;You need to interleave both datasets, outputting only those observations for which first.id and last.id are not true / one at the same time.&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set one two;
   by ID;
   
   if not (first.id and last.id);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;</description>
      <pubDate>Wed, 10 Mar 2021 06:28:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-combine-two-dataset-to-read-only-observations-that-are-in/m-p/725062#M225167</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-03-10T06:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to combine two dataset to read only observations that are in both data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-combine-two-dataset-to-read-only-observations-that-are-in/m-p/725105#M225183</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input ID   A   B   ;
cards; 
10   1   2                          
20   3   4                          
30   5   6                 
;
data two;
input ID   A  B ;
cards; 
 10   0  4
 30   5  2
 40   7  3
 ;

 proc sql;
 create table want as
 select * from one where id in (select id from two)
 union all
 select * from two where id in (select id from one) 
order by id;
 quit;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Mar 2021 11:16:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-combine-two-dataset-to-read-only-observations-that-are-in/m-p/725105#M225183</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-03-10T11:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to combine two dataset to read only observations that are in both data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-combine-two-dataset-to-read-only-observations-that-are-in/m-p/725220#M225221</link>
      <description>&lt;P&gt;Is it possible that there are two or more observations for a single ID in one dataset?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 17:55:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-combine-two-dataset-to-read-only-observations-that-are-in/m-p/725220#M225221</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-03-10T17:55:59Z</dc:date>
    </item>
  </channel>
</rss>

