<?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: Finding whether a date occurred within an interval in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Finding-whether-a-date-occurred-within-an-interval/m-p/529434#M144659</link>
    <description>&lt;P&gt;Thank you for the prompt response!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jan 2019 16:12:25 GMT</pubDate>
    <dc:creator>lillymaginta</dc:creator>
    <dc:date>2019-01-23T16:12:25Z</dc:date>
    <item>
      <title>Finding whether a date occurred within an interval</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-whether-a-date-occurred-within-an-interval/m-p/529428#M144655</link>
      <description>&lt;P&gt;I am trying to find to retain the value of 1 if a specific date (dg_date) occurred&amp;nbsp;within an interval and 0 otherwise. The interval start and end date are presented with the variables, start and end.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
  input patientid  dg_date : mmddyy10. start : mmddyy10. send : mmddyy10. ;
  format  dg_date start end  mmddyy10.;
datalines;1 5/5/2009  1/1/2006 2/2/2006
1 5/5/2009  2/2/2007 3/2/2007
1 5/5/2009  5/1/2009 6/1/2009
1 5/5/2009  7/7/2009 12/1/2009 
2  1/2/2007 1/2/2006 12/2/2006
2  1/2/2007 12/31/2006 5/5/2007
2 1/2/2007 6/6/2007 7/7/2007;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;LI-CODE lang="sas"&gt;
Output 
patientid outcome 
1    0
1    0
1    1
1    0
2    0
2    1
2    0 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 16:03:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-whether-a-date-occurred-within-an-interval/m-p/529428#M144655</guid>
      <dc:creator>lillymaginta</dc:creator>
      <dc:date>2019-01-23T16:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Finding whether a date occurred within an interval</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-whether-a-date-occurred-within-an-interval/m-p/529430#M144656</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set a;

if start &amp;lt; dg_date &amp;lt; send then flag=1;
else flag=0;

run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/72105"&gt;@lillymaginta&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to find to retain the value of 1 if a specific date (dg_date) occurred&amp;nbsp;within an interval and 0 otherwise. The interval start and end date are presented with the variables, start and end.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
  input patientid  dg_date : mmddyy10. start : mmddyy10. send : mmddyy10. ;
  format  dg_date start end  mmddyy10.;
datalines;1 5/5/2009  1/1/2006 2/2/2006
1 5/5/2009  2/2/2007 3/2/2007
1 5/5/2009  5/1/2009 6/1/2009
1 5/5/2009  7/7/2009 12/1/2009 
2  1/2/2007 1/2/2006 12/2/2006
2  1/2/2007 12/31/2006 5/5/2007
2 1/2/2007 6/6/2007 7/7/2007;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;LI-CODE lang="sas"&gt;
Output 
patientid outcome 
1    0
1    0
1    1
1    0
2    0
2    1
2    0 &lt;CODE&gt;&lt;/CODE&gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 16:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-whether-a-date-occurred-within-an-interval/m-p/529430#M144656</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-23T16:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Finding whether a date occurred within an interval</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-whether-a-date-occurred-within-an-interval/m-p/529431#M144657</link>
      <description>I just an IF that tries the interval?&lt;BR /&gt;start &amp;lt;= dg_date &amp;lt;= end</description>
      <pubDate>Wed, 23 Jan 2019 16:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-whether-a-date-occurred-within-an-interval/m-p/529431#M144657</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2019-01-23T16:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Finding whether a date occurred within an interval</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-whether-a-date-occurred-within-an-interval/m-p/529434#M144659</link>
      <description>&lt;P&gt;Thank you for the prompt response!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 16:12:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-whether-a-date-occurred-within-an-interval/m-p/529434#M144659</guid>
      <dc:creator>lillymaginta</dc:creator>
      <dc:date>2019-01-23T16:12:25Z</dc:date>
    </item>
  </channel>
</rss>

