<?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: Checking if a transaction date falls between a begin_date and end_date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204421#M306305</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #000000; font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;SPAN style="font-size: 12pt; font-style: inherit; font-weight: inherit;"&gt;The join will produce duplicates, if date &lt;/SPAN&gt;&lt;SPAN style="font-size: 16px;"&gt;intervals&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-style: inherit; font-weight: inherit;"&gt; in the second dataset overlap.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; font-weight: inherit;"&gt;On the other hand, if you decide not to include detailed information from this second table, you can aggregate the result of join:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;create table test as&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;select&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;a.id&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;, a.transaction_date&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;, a.group&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;STRONG&gt;, max(b.group is not missing) as flag&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;from transaction_table a&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;left outer join&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;period_table b&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;on a.transaction_date between b.period_start and b.period_end&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;and a.group = b.group&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;&lt;STRONG&gt;group by 1,2,3&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Mar 2015 12:03:18 GMT</pubDate>
    <dc:creator>gergely_batho</dc:creator>
    <dc:date>2015-03-19T12:03:18Z</dc:date>
    <item>
      <title>Checking if a transaction date falls between a begin_date and end_date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204415#M306299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greeting all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need some help with checking if a transaction date falls between a begin_date and end_date column and flagging the record&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The transaction table for simplicity contain 2 columns an id and transaction date with potential duplicates while a second table &lt;SPAN style="font-size: 13.3333330154419px;"&gt;(no duplicate rows) &lt;/SPAN&gt;contain the following information, the begin_date and end_date but can be repeated for different groups as shown below (I only shown 2 groups here -approx 50 groups in total)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2016 PERIOD 1 G '10Jan2016'd '28Jan2016'd&lt;/P&gt;&lt;P&gt;2016 PERIOD 1 H '10Jan2016'd '28Jan2016'd&lt;/P&gt;&lt;P&gt;2016 PERIOD 2 G '04Jul2016'd '19Jul2016'd&lt;/P&gt;&lt;P&gt;2016 PERIOD 2 H '04Jul2016'd '19Jul2016'd&lt;/P&gt;&lt;P&gt;2016 PERIOD 3 G '26Sep2016'd '11Oct2016'd&lt;/P&gt;&lt;P&gt;2016 PERIOD 3 H '26Sep2016'd '11Oct2016'd&lt;/P&gt;&lt;P&gt;2016 PERIOD 4 G '18Dec2016'd '31Jan2017'd&lt;/P&gt;&lt;P&gt;2016 PERIOD 4 H '19Dec2016'd '28Jan2017'd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My final table would contain the 2 columns (id &amp;amp; transaction date) plus the indicator variable 1/0 if the transaction date is indeed between those 2 dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 10:53:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204415#M306299</guid>
      <dc:creator>peterthiem</dc:creator>
      <dc:date>2015-03-18T10:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Checking if a transaction date falls between a begin_date and end_date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204416#M306300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just do a left join using a between - and condition. Set the flag if you got a match (or not).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 10:58:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204416#M306300</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-03-18T10:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Checking if a transaction date falls between a begin_date and end_date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204417#M306301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there an ID in the second table?&amp;nbsp; What are you joining the tables on?&amp;nbsp; After you join the table you can do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;if begin_date &amp;lt; transaction_date &amp;lt; end_date then flag = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else flag = 0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 11:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204417#M306301</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-03-18T11:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Checking if a transaction date falls between a begin_date and end_date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204418#M306302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No need for a second step.&lt;/P&gt;&lt;P&gt;Just test on the occurrence of the id variable in the right table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 12:48:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204418#M306302</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-03-18T12:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Checking if a transaction date falls between a begin_date and end_date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204419#M306303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Linus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without an ID in the second table how would you be joining?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 16:44:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204419#M306303</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-03-18T16:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Checking if a transaction date falls between a begin_date and end_date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204420#M306304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;Hi Mark and Linus the problem is that the id in the second table.is different to that of the first i.e.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;PERIOD_IDENTIFIER YEAR PERIOD GROUP&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;1111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2016 PERIOD 1 G '10Jan2016'd '28Jan2016'd&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;1112&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2016 PERIOD 1 H '10Jan2016'd '28Jan2016'd&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;1113&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2016 PERIOD 2 G '04Jul2016'd '19Jul2016'd&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;1114&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2016 PERIOD 2 H '04Jul2016'd '19Jul2016'd&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;1115&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2016 PERIOD 3 G '26Sep2016'd '11Oct2016'd&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;1116&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2016 PERIOD 3 H '26Sep2016'd '11Oct2016'd&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;1117&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2016 PERIOD 4 G '18Dec2016'd '31Jan2017'd&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;1118&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2016 PERIOD 4 H '19Dec2016'd '28Jan2017'd&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;I mean we can try to append all the date that are between the date range with the PERIOD_IDENTIFIER appended to the first (transaction) table but we first need to join these 2 tables somehow.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;The first tables will have duplicates but the second table the identifier is unique.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="background-position: initial;"&gt;&lt;SPAN style="color: black; font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;The WANT data set look something like this&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="background-position: initial;"&gt; &lt;/PRE&gt;&lt;PRE style="background-position: initial;"&gt;&lt;SPAN style="color: black; font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;id transaction_date group PERIOD_START PERIOD_END FLAG&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="background-position: initial;"&gt;&lt;SPAN style="color: black; font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19/03/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; G&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="background-position: initial;"&gt;&lt;SPAN style="color: black; font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21/01/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; H&amp;nbsp;&amp;nbsp; '10Jan2016'd&amp;nbsp;&amp;nbsp; '28Jan2016'd&amp;nbsp; 1&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="background-position: initial;"&gt;&lt;SPAN style="color: black; font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05/07/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; H&amp;nbsp;&amp;nbsp; '04Jul2016'd&amp;nbsp;&amp;nbsp;&amp;nbsp; '19Jul2016'd&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="background-position: initial;"&gt;&lt;SPAN style="color: black; font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 27/09/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; G&amp;nbsp;&amp;nbsp; '26Sep2016'd&amp;nbsp;&amp;nbsp; '11Oct2016'd&amp;nbsp; 1&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="background-position: initial;"&gt;&lt;SPAN style="color: black; font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 25/03/2016&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; G&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="background-position: initial;"&gt;&lt;SPAN style="color: black; font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/01/2017&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; H&amp;nbsp;&amp;nbsp;&amp;nbsp; '19Dec2016'd '28Jan2017'd&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;So far I have attempted the following codes which returns duplicates&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;create table test as&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;select&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="color: black; font-family: calibri, verdana, arial, sans-serif; font-size: 12pt; line-height: 1.5em; background-color: transparent;"&gt;a.id&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;, a.transaction_date&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;, a.group&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;, b.period_start&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;, b.period_end&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;, flag&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;from transaction_table a&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;left outer join&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;period_table b&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;on a.transaction_date between b.period_start and b.period_end&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;and a.group = b.group&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;Unless I'm missing out something or proc sql might not be good for this task.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 20:52:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204420#M306304</guid>
      <dc:creator>peterthiem</dc:creator>
      <dc:date>2015-03-18T20:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Checking if a transaction date falls between a begin_date and end_date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204421#M306305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #000000; font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;SPAN style="font-size: 12pt; font-style: inherit; font-weight: inherit;"&gt;The join will produce duplicates, if date &lt;/SPAN&gt;&lt;SPAN style="font-size: 16px;"&gt;intervals&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-style: inherit; font-weight: inherit;"&gt; in the second dataset overlap.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; font-weight: inherit;"&gt;On the other hand, if you decide not to include detailed information from this second table, you can aggregate the result of join:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;create table test as&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;select&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;a.id&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;, a.transaction_date&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;, a.group&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;STRONG&gt;, max(b.group is not missing) as flag&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;from transaction_table a&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;left outer join&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;period_table b&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;on a.transaction_date between b.period_start and b.period_end&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;and a.group = b.group&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;&lt;STRONG&gt;group by 1,2,3&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif; color: black;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2015 12:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-if-a-transaction-date-falls-between-a-begin-date-and/m-p/204421#M306305</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2015-03-19T12:03:18Z</dc:date>
    </item>
  </channel>
</rss>

