<?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 link table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496071#M131094</link>
    <description>&lt;P&gt;No, still doesn't work&lt;/P&gt;</description>
    <pubDate>Sun, 16 Sep 2018 19:48:41 GMT</pubDate>
    <dc:creator>Songchan</dc:creator>
    <dc:date>2018-09-16T19:48:41Z</dc:date>
    <item>
      <title>proc sql link table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496065#M131090</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to combine two data sets temp03 and temp04 using proc sql select, but it turns out that data set temp04 in my table link is empty.&lt;/P&gt;&lt;P&gt;what's the possible reason of that problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table link as&lt;BR /&gt;select distinct temp03.*,temp04.*&lt;BR /&gt;from temp03 as a&lt;BR /&gt;left join temp04(where=(linktype in ('LC' 'LU') and&lt;BR /&gt;linkprim in ('P' 'C' 'J'))) as b&lt;BR /&gt;&lt;BR /&gt;on a.permno=b.lpermno and b.linkdt&amp;lt;a.date;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Sep 2018 19:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496065#M131090</guid>
      <dc:creator>Songchan</dc:creator>
      <dc:date>2018-09-16T19:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql link table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496066#M131091</link>
      <description>&lt;P&gt;Remove your WHERE conditions and add them one at a time to see if one is returning an empty table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/230936"&gt;@Songchan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello there,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to combine two data sets temp03 and temp04 using proc sql select, but it turns out that data set temp04 in my table link is empty.&lt;/P&gt;
&lt;P&gt;what's the possible reason of that problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table link as&lt;BR /&gt;select distinct temp03.*,temp04.*&lt;BR /&gt;from temp03 as a&lt;BR /&gt;left join temp04(where=(linktype in ('LC' 'LU') and&lt;BR /&gt;linkprim in ('P' 'C' 'J'))) as b&lt;BR /&gt;&lt;BR /&gt;on a.permno=b.lpermno and b.linkdt&amp;lt;a.date;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Sep 2018 19:35:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496066#M131091</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-16T19:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql link table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496067#M131092</link>
      <description>&lt;P&gt;I have not seen the data but would this work:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table link as
select distinct a.*, b.*
from temp03 as a
left join temp04(where=(upcase(linktype) in ('LC' 'LU') and
upcase(linkprim) in ('P' 'C' 'J'))) as b

on a.permno=b.lpermno and b.linkdt&amp;lt;a.date;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 16 Sep 2018 19:40:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496067#M131092</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-09-16T19:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql link table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496070#M131093</link>
      <description>&lt;P&gt;Thanks for replying,&lt;/P&gt;&lt;P&gt;but it still doesn't work&lt;/P&gt;</description>
      <pubDate>Sun, 16 Sep 2018 19:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496070#M131093</guid>
      <dc:creator>Songchan</dc:creator>
      <dc:date>2018-09-16T19:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql link table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496071#M131094</link>
      <description>&lt;P&gt;No, still doesn't work&lt;/P&gt;</description>
      <pubDate>Sun, 16 Sep 2018 19:48:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496071#M131094</guid>
      <dc:creator>Songchan</dc:creator>
      <dc:date>2018-09-16T19:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql link table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496072#M131095</link>
      <description>&lt;P&gt;is it posable that b.linkdt &amp;lt;= a.date ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Sep 2018 19:49:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496072#M131095</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-09-16T19:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql link table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496073#M131096</link>
      <description>No, still empty for data set temp04</description>
      <pubDate>Sun, 16 Sep 2018 19:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496073#M131096</guid>
      <dc:creator>Songchan</dc:creator>
      <dc:date>2018-09-16T19:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql link table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496074#M131097</link>
      <description>&lt;P&gt;The condition b.linkdt&amp;lt;a.date might be a comparison between a datetime value (b.linkdt)&amp;nbsp;and a date value (a.date). try changing to&lt;/P&gt;
&lt;P&gt;datepart(b.linkdt) &amp;lt; a.date&lt;/P&gt;</description>
      <pubDate>Sun, 16 Sep 2018 20:00:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496074#M131097</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-09-16T20:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql link table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496077#M131099</link>
      <description>Thank you PG! it works!</description>
      <pubDate>Sun, 16 Sep 2018 20:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-link-table/m-p/496077#M131099</guid>
      <dc:creator>Songchan</dc:creator>
      <dc:date>2018-09-16T20:11:20Z</dc:date>
    </item>
  </channel>
</rss>

