<?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: merge two tables with closest value of b.time that is less than a.time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/merge-two-tables-with-closest-value-of-b-time-that-is-less-than/m-p/784929#M250477</link>
    <description>&lt;P&gt;See&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/ERROR-Sort-execution-failure-in-PROC-SQL/td-p/262581" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/ERROR-Sort-execution-failure-in-PROC-SQL/td-p/262581&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Dec 2021 15:48:09 GMT</pubDate>
    <dc:creator>EyalGonen</dc:creator>
    <dc:date>2021-12-08T15:48:09Z</dc:date>
    <item>
      <title>merge two tables with closest value of b.time that is less than a.time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-two-tables-with-closest-value-of-b-time-that-is-less-than/m-p/784914#M250471</link>
      <description>&lt;P&gt;I have two tables (a and b) where both tables have column "time" and the tables has different number of rows (b has more rows than a)&lt;BR /&gt;&lt;BR /&gt;However, a.time and b.time are not the same and I hope to merge the two tables to a, using time as constraint.&lt;BR /&gt;&lt;BR /&gt;I want data from b only be merge to a, where b.time is the closest time to a.time, but less than a.time.&lt;BR /&gt;&lt;BR /&gt;Thinking how to use proc sql for the data.... my previous attempts reported an error for insufficient memory... Many Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 14:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-two-tables-with-closest-value-of-b-time-that-is-less-than/m-p/784914#M250471</guid>
      <dc:creator>theflunkee</dc:creator>
      <dc:date>2021-12-08T14:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: merge two tables with closest value of b.time that is less than a.time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-two-tables-with-closest-value-of-b-time-that-is-less-than/m-p/784919#M250473</link>
      <description>&lt;P&gt;An approach with SQL could be to join tables by a.time &amp;gt;= b.time (or maybe by a.time between b.time and b.time - 1 week for example to limit the results) that would produce a 1:n join then you could group by a.time and select the rows HAVING b.time = max(b.time)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 14:24:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-two-tables-with-closest-value-of-b-time-that-is-less-than/m-p/784919#M250473</guid>
      <dc:creator>EyalGonen</dc:creator>
      <dc:date>2021-12-08T14:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: merge two tables with closest value of b.time that is less than a.time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-two-tables-with-closest-value-of-b-time-that-is-less-than/m-p/784921#M250475</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I got the following error....&lt;BR /&gt;ERROR: Sort execution failure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sql; create table a_vs_b
as select a.S1, b.S2
from tablea as a left join tables as b
on a.time &amp;gt;= b.time
group by a.time
having b.time=max(b.time);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Dec 2021 14:41:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-two-tables-with-closest-value-of-b-time-that-is-less-than/m-p/784921#M250475</guid>
      <dc:creator>theflunkee</dc:creator>
      <dc:date>2021-12-08T14:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: merge two tables with closest value of b.time that is less than a.time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-two-tables-with-closest-value-of-b-time-that-is-less-than/m-p/784929#M250477</link>
      <description>&lt;P&gt;See&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/ERROR-Sort-execution-failure-in-PROC-SQL/td-p/262581" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/ERROR-Sort-execution-failure-in-PROC-SQL/td-p/262581&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 15:48:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-two-tables-with-closest-value-of-b-time-that-is-less-than/m-p/784929#M250477</guid>
      <dc:creator>EyalGonen</dc:creator>
      <dc:date>2021-12-08T15:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: merge two tables with closest value of b.time that is less than a.time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-two-tables-with-closest-value-of-b-time-that-is-less-than/m-p/785089#M250536</link>
      <description>&lt;P&gt;Please post data in usable form and the expected result.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 07:47:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-two-tables-with-closest-value-of-b-time-that-is-less-than/m-p/785089#M250536</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-12-09T07:47:30Z</dc:date>
    </item>
  </channel>
</rss>

