<?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: how to combine two dataset with different variables in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/how-to-combine-two-dataset-with-different-variables/m-p/725169#M28056</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    merge one(in=in1) two(in=in2);
    by id;
    if in1 and in2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the future, please provide data as SAS data step code, so we can actually use it to test the code we provide. This helps all of us out, and gets you faster and more likely correct answers. Here are the instructions:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/&lt;/A&gt;. Do not provide the data in other forms.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Mar 2021 15:16:47 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-03-10T15:16:47Z</dc:date>
    <item>
      <title>how to combine two dataset with different variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-combine-two-dataset-with-different-variables/m-p/725168#M28055</link>
      <description>&lt;DIV class="forum-subj-action"&gt;
&lt;DIV class="lia-message-subject lia-component-message-view-widget-subject"&gt;
&lt;DIV class="MessageSubject"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="forum-post"&gt;
&lt;DIV id="bodyDisplay_39e9e2b2b47fc5" class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;
&lt;DIV class="lia-message-body-content"&gt;
&lt;P&gt;&lt;SPAN&gt;I have&amp;nbsp;two dataset similar to the examples below, both datasets have different variables. i wanted to read only observations (IDs) 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;C D&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;C&amp;nbsp; D&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; 0&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;&lt;BR /&gt;&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; &amp;nbsp; 5&amp;nbsp; 2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&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;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 10 Mar 2021 15:12:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-combine-two-dataset-with-different-variables/m-p/725168#M28055</guid>
      <dc:creator>hjjijkkl</dc:creator>
      <dc:date>2021-03-10T15:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to combine two dataset with different variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-combine-two-dataset-with-different-variables/m-p/725169#M28056</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    merge one(in=in1) two(in=in2);
    by id;
    if in1 and in2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the future, please provide data as SAS data step code, so we can actually use it to test the code we provide. This helps all of us out, and gets you faster and more likely correct answers. Here are the instructions:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/&lt;/A&gt;. Do not provide the data in other forms.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 15:16:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-combine-two-dataset-with-different-variables/m-p/725169#M28056</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-03-10T15:16:47Z</dc:date>
    </item>
  </channel>
</rss>

