<?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: PROC SQL help in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/PROC-SQL-help/m-p/670181#M23288</link>
    <description>And just a quick note that the SQL documentation has many examples that come in useful. &lt;BR /&gt;&lt;A href="https://documentation.sas.com/?docsetId=sqlproc&amp;amp;docsetTarget=n1ncn0pznd8wrln1tnp3xdxjz9xz.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=sqlproc&amp;amp;docsetTarget=n1ncn0pznd8wrln1tnp3xdxjz9xz.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 17 Jul 2020 17:44:32 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-07-17T17:44:32Z</dc:date>
    <item>
      <title>PROC SQL help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SQL-help/m-p/670178#M23286</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need some help with a proc SQL problem. Take the sample data below:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Table 1&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Code&amp;nbsp; &amp;nbsp; &amp;nbsp; Description&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Y&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Z&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Table 2&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Code&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; b&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I want to pull all the observations from Table 2 that have a matching Code from Table 1 (so this would be Code 2 and Code 3).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to do this in SAS (I presume it is easiest with proc SQL but if it works with a data step that is great too)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 17:35:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SQL-help/m-p/670178#M23286</guid>
      <dc:creator>marleeakerson</dc:creator>
      <dc:date>2020-07-17T17:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SQL-help/m-p/670179#M23287</link>
      <description>Do you want other columns for Table2?&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table want as select * from table1 where code in (select code from table2);&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table want as select t1.*, t2.ID&lt;BR /&gt;from table1 t1 right join&lt;BR /&gt;table2 t2&lt;BR /&gt;on t1.code=t2.code;&lt;BR /&gt;quit;</description>
      <pubDate>Fri, 17 Jul 2020 17:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SQL-help/m-p/670179#M23287</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-17T17:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SQL-help/m-p/670181#M23288</link>
      <description>And just a quick note that the SQL documentation has many examples that come in useful. &lt;BR /&gt;&lt;A href="https://documentation.sas.com/?docsetId=sqlproc&amp;amp;docsetTarget=n1ncn0pznd8wrln1tnp3xdxjz9xz.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=sqlproc&amp;amp;docsetTarget=n1ncn0pznd8wrln1tnp3xdxjz9xz.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Jul 2020 17:44:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SQL-help/m-p/670181#M23288</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-17T17:44:32Z</dc:date>
    </item>
  </channel>
</rss>

