<?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: Extracting records based on a field in another dataset in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Extracting-records-based-on-a-field-in-another-dataset/m-p/90899#M25947</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To create a new dataset with all fields from A plus the Region you could use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table C as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select A.*, B.region&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from A left join B on A.id=B.id;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 May 2013 00:50:09 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2013-05-31T00:50:09Z</dc:date>
    <item>
      <title>Extracting records based on a field in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extracting-records-based-on-a-field-in-another-dataset/m-p/90898#M25946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm a SAS beginner facing what seems to be an advanced question not addressed in the Enterprise Guide. Two datasets A and B both contain the same ID field.&amp;nbsp; Dataset B has a Region field.&amp;nbsp; Each ID in dataset B has a unique Region.&amp;nbsp; I want to extract all the records in dataset A which have Region = 1 in dataset B.&amp;nbsp; (Or Region = whatever value I choose.)&amp;nbsp; Is there something obvious I am overlooking?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or equally useful, I suppose, would be an approach to add the Region field to dataset A based on its values in Dataset B.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 00:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extracting-records-based-on-a-field-in-another-dataset/m-p/90898#M25946</guid>
      <dc:creator>Kolmashekidim</dc:creator>
      <dc:date>2013-05-31T00:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting records based on a field in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extracting-records-based-on-a-field-in-another-dataset/m-p/90899#M25947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To create a new dataset with all fields from A plus the Region you could use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table C as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select A.*, B.region&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from A left join B on A.id=B.id;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 00:50:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extracting-records-based-on-a-field-in-another-dataset/m-p/90899#M25947</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-05-31T00:50:09Z</dc:date>
    </item>
  </channel>
</rss>

