<?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: Creating a subset of observations in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-subset-of-observations/m-p/176895#M45335</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do&amp;nbsp; you want to keep the vars in both data sets?&amp;nbsp; I will assume&amp;nbsp; you do.&amp;nbsp; If you want only those observations where the ID is the same in both datasets:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table join1 as&lt;/P&gt;&lt;P&gt;select a.*, b.* from dataset1 as a&lt;/P&gt;&lt;P&gt;inner join dataset2 as b&lt;/P&gt;&lt;P&gt;on a.Uni_id=b.Uni_id&lt;/P&gt;&lt;P&gt;quit:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will get a warning saying that Uni_id appears in both data sets and it will the value of Uni_id in dataset1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Feb 2015 16:54:27 GMT</pubDate>
    <dc:creator>GreggB</dc:creator>
    <dc:date>2015-02-20T16:54:27Z</dc:date>
    <item>
      <title>Creating a subset of observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-subset-of-observations/m-p/176894#M45334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have two datasets which has the same variable (Uni_Id). I want to create a subset of dataset1 such that the new subset will contain the observations whose uni_id values are equal to the values for this variable in the other dataset, dataset2.&lt;/P&gt;&lt;P&gt;I appreciate any suggestion. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Feb 2015 16:10:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-subset-of-observations/m-p/176894#M45334</guid>
      <dc:creator>m1986MM</dc:creator>
      <dc:date>2015-02-20T16:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a subset of observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-subset-of-observations/m-p/176895#M45335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do&amp;nbsp; you want to keep the vars in both data sets?&amp;nbsp; I will assume&amp;nbsp; you do.&amp;nbsp; If you want only those observations where the ID is the same in both datasets:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table join1 as&lt;/P&gt;&lt;P&gt;select a.*, b.* from dataset1 as a&lt;/P&gt;&lt;P&gt;inner join dataset2 as b&lt;/P&gt;&lt;P&gt;on a.Uni_id=b.Uni_id&lt;/P&gt;&lt;P&gt;quit:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will get a warning saying that Uni_id appears in both data sets and it will the value of Uni_id in dataset1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Feb 2015 16:54:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-subset-of-observations/m-p/176895#M45335</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2015-02-20T16:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a subset of observations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-subset-of-observations/m-p/176896#M45336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Feb 2015 02:07:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-subset-of-observations/m-p/176896#M45336</guid>
      <dc:creator>m1986MM</dc:creator>
      <dc:date>2015-02-21T02:07:30Z</dc:date>
    </item>
  </channel>
</rss>

