<?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: Merging datasets but with specificity of duration of observations by dates in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Merging-datasets-but-with-specificity-of-duration-of/m-p/840078#M36402</link>
    <description>&lt;P&gt;I really appreciate your prompt response. Thanks. I had a detour on the approach and will get back for further clarifications.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 22 Oct 2022 12:52:43 GMT</pubDate>
    <dc:creator>femiajumobi1</dc:creator>
    <dc:date>2022-10-22T12:52:43Z</dc:date>
    <item>
      <title>Merging datasets but with specificity of duration of observations by dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Merging-datasets-but-with-specificity-of-duration-of/m-p/839281#M36346</link>
      <description>&lt;P&gt;I wish to merge two datasets: Data_A and Data_B using ID. I am only interested in observations in B with dates variable FDS_B that are within 14 days of each of the dates in A (FDS_A). The date format is&amp;nbsp;MM/DD/YYYY.&amp;nbsp; How do I improve the code below if I were to include FDS_A and FDS_B?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data want;&lt;BR /&gt;Merge&amp;nbsp; Data_A Data_B;&lt;BR /&gt;by ID;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 20:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Merging-datasets-but-with-specificity-of-duration-of/m-p/839281#M36346</guid>
      <dc:creator>femiajumobi1</dc:creator>
      <dc:date>2022-10-18T20:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Merging datasets but with specificity of duration of observations by dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Merging-datasets-but-with-specificity-of-duration-of/m-p/839290#M36347</link>
      <description>&lt;P&gt;Maybe something along the lines of&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Proc sql;
   create table want a
   select a,*, b.fds_b
   from data_a as a
           left join
           data_b as b
           on a.id=b.id
   where abs(a.fds_a-b.fds_b) le 14
  ;
quit;&lt;/PRE&gt;
&lt;P&gt;Maybe. If your Fds variables are actual SAS date variables.&lt;/P&gt;
&lt;P&gt;You do not mention any other variables from Data_b. You would have to explicitly list them using the b.variable syntax. If the variable is the same name as one in Data_A do you expect it to be a different variable or replace the value of the variable in the Data_a.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am a bit concerned about exactly what &lt;STRONG&gt;you &lt;/STRONG&gt;mean by "each of the dates in A". That could be taken different ways.&lt;/P&gt;
&lt;P&gt;If the above suggestion doesn't come close then show some example data from each of the two sets and what you expect for the result.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 21:02:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Merging-datasets-but-with-specificity-of-duration-of/m-p/839290#M36347</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-18T21:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Merging datasets but with specificity of duration of observations by dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Merging-datasets-but-with-specificity-of-duration-of/m-p/839303#M36348</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;What do you want your output dataset to look like?&lt;/LI&gt;
&lt;LI&gt;Will it have any unmatched obs from a or b?&lt;/LI&gt;
&lt;LI&gt;What if multiple b's match a single a, or vice versa?&lt;/LI&gt;
&lt;LI&gt;Or worse yet, what if multiple b's match multiple a's?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Some of these questions will be simplified if we knew (for instance) that either a or b was limited to one obs per id.&amp;nbsp; Is that the case/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you provided some sample data in the form of a working data step, I think you will get some suggested code to address the request.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 02:35:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Merging-datasets-but-with-specificity-of-duration-of/m-p/839303#M36348</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2022-10-19T02:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Merging datasets but with specificity of duration of observations by dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Merging-datasets-but-with-specificity-of-duration-of/m-p/839352#M36350</link>
      <description>&lt;P&gt;proc sql with inexact matching.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 11:58:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Merging-datasets-but-with-specificity-of-duration-of/m-p/839352#M36350</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-10-19T11:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Merging datasets but with specificity of duration of observations by dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Merging-datasets-but-with-specificity-of-duration-of/m-p/840078#M36402</link>
      <description>&lt;P&gt;I really appreciate your prompt response. Thanks. I had a detour on the approach and will get back for further clarifications.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2022 12:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Merging-datasets-but-with-specificity-of-duration-of/m-p/840078#M36402</guid>
      <dc:creator>femiajumobi1</dc:creator>
      <dc:date>2022-10-22T12:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Merging datasets but with specificity of duration of observations by dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Merging-datasets-but-with-specificity-of-duration-of/m-p/840079#M36403</link>
      <description>I really appreciate your prompt response. Thanks. I had a detour on the approach and will get back for further clarifications.&amp;nbsp;</description>
      <pubDate>Sat, 22 Oct 2022 12:53:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Merging-datasets-but-with-specificity-of-duration-of/m-p/840079#M36403</guid>
      <dc:creator>femiajumobi1</dc:creator>
      <dc:date>2022-10-22T12:53:34Z</dc:date>
    </item>
  </channel>
</rss>

