<?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: Conditional join on two variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Conditional-join-on-two-variables/m-p/249888#M47072</link>
    <description>Just inner join on Id and Date = min_date?&lt;BR /&gt;&lt;BR /&gt;If I understand correctly you can do this on one pass of the data, avoiding the join.&lt;BR /&gt;You could use group by ID and do having date = min (date).</description>
    <pubDate>Sat, 13 Feb 2016 20:03:26 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2016-02-13T20:03:26Z</dc:date>
    <item>
      <title>Conditional join on two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-join-on-two-variables/m-p/249887#M47071</link>
      <description>&lt;P&gt;I am trying to remerge two datasets under the following conditions:&lt;/P&gt;&lt;P&gt;dataset1: more than one observation per id and multiple date per id&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id &amp;nbsp; date &amp;nbsp;age sex&lt;/P&gt;&lt;P&gt;1 &amp;nbsp;..&lt;/P&gt;&lt;P&gt;2...&lt;/P&gt;&lt;P&gt;3...&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;I created dataset 2 and selected distint id and the min(date)&lt;/P&gt;&lt;P&gt;dataset 2, one observation per id&amp;nbsp;&lt;/P&gt;&lt;P&gt;id &amp;nbsp;min_date&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;Now I want to remerge the data back to get all the other variables, how can I create an inner joint statement using both id and min(date) to get the other information specific to that date in the original dataset&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Feb 2016 19:57:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-join-on-two-variables/m-p/249887#M47071</guid>
      <dc:creator>lillymaginta</dc:creator>
      <dc:date>2016-02-13T19:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional join on two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-join-on-two-variables/m-p/249888#M47072</link>
      <description>Just inner join on Id and Date = min_date?&lt;BR /&gt;&lt;BR /&gt;If I understand correctly you can do this on one pass of the data, avoiding the join.&lt;BR /&gt;You could use group by ID and do having date = min (date).</description>
      <pubDate>Sat, 13 Feb 2016 20:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-join-on-two-variables/m-p/249888#M47072</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-13T20:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional join on two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-join-on-two-variables/m-p/249890#M47073</link>
      <description>&lt;P&gt;Thanks it worked!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Feb 2016 20:49:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-join-on-two-variables/m-p/249890#M47073</guid>
      <dc:creator>lillymaginta</dc:creator>
      <dc:date>2016-02-13T20:49:06Z</dc:date>
    </item>
  </channel>
</rss>

