<?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: Joining Dates between periods in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-Dates-between-periods/m-p/429189#M27686</link>
    <description>&lt;P&gt;Your question needs to be well explained.&lt;/P&gt;&lt;P&gt;1. Give us the community sample data&lt;/P&gt;&lt;P&gt;2. Explain your requirement referring to the data in your sample&lt;/P&gt;&lt;P&gt;3. Also give us the output sample that you want&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please be clearly descriptive as possible. Thank you!&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jan 2018 16:59:50 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-01-19T16:59:50Z</dc:date>
    <item>
      <title>Joining Dates between periods</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-Dates-between-periods/m-p/429173#M27685</link>
      <description>&lt;P&gt;I am needing to join tables on for an event date, but to also pull in any data for one day before and one day after the event date. Not sure how to write the code for the join?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 16:19:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-Dates-between-periods/m-p/429173#M27685</guid>
      <dc:creator>Tihannah</dc:creator>
      <dc:date>2018-01-19T16:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Joining Dates between periods</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-Dates-between-periods/m-p/429189#M27686</link>
      <description>&lt;P&gt;Your question needs to be well explained.&lt;/P&gt;&lt;P&gt;1. Give us the community sample data&lt;/P&gt;&lt;P&gt;2. Explain your requirement referring to the data in your sample&lt;/P&gt;&lt;P&gt;3. Also give us the output sample that you want&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please be clearly descriptive as possible. Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 16:59:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-Dates-between-periods/m-p/429189#M27686</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-19T16:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Joining Dates between periods</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-Dates-between-periods/m-p/429193#M27687</link>
      <description>&lt;P&gt;I figured it out. &lt;SPAN&gt;Simple fix. Just couldn't think at the moment.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code I used was:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Left join) where t2.date between t1.date-1 and t1.date+1&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, 19 Jan 2018 17:14:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-Dates-between-periods/m-p/429193#M27687</guid>
      <dc:creator>Tihannah</dc:creator>
      <dc:date>2018-01-19T17:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Joining Dates between periods</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-Dates-between-periods/m-p/429199#M27689</link>
      <description>&lt;P&gt;made up an example, may be something like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input name $ event:mmddyy10.;
format event mmddyy10.;
datalines;
smith 09/23/2005
Sam 10/11/2016
Pam 05/15/2016
;
run;


data have2;
input name $ event1:mmddyy10. price;
format event1 mmddyy10.;
datalines;
smith 09/23/2005 10
smith 09/02/2005 20
smith 09/24/2005 25
smith 09/28/2005 35
Sam 10/11/2016 22
Sam 10/12/2016 17
Sam 10/11/2016 60
Sam 10/02/2016 70
Pam 05/18/2016 50
;
run;

proc sql;
select a.name, event1, price 
from have1 a
inner join
have2 b
on a.name =b.name
and (a.event=b.event1
or a.event=b.event1 -1
or a.event=b.event1 +1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Jan 2018 17:18:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-Dates-between-periods/m-p/429199#M27689</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-01-19T17:18:54Z</dc:date>
    </item>
  </channel>
</rss>

