<?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: Determining continuous enrollment for 6 months in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Determining-continuous-enrollment-for-6-months/m-p/408950#M279504</link>
    <description>&lt;P&gt;Post some more example data &lt;U&gt;&lt;STRONG&gt;and the corresponding expected output.&lt;/STRONG&gt;&lt;/U&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you search on here, it's been answered multiple times, but with a different data structure, a long rather than wide data set.&lt;/P&gt;</description>
    <pubDate>Tue, 31 Oct 2017 00:26:18 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-10-31T00:26:18Z</dc:date>
    <item>
      <title>Determining continuous enrollment for 6 months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determining-continuous-enrollment-for-6-months/m-p/408947#M279503</link>
      <description>&lt;P&gt;I have a dataset that looks similar to this&lt;BR /&gt;&lt;BR /&gt;MemberID&amp;nbsp; &amp;nbsp;StartDate1&amp;nbsp; &amp;nbsp;EndDate1&amp;nbsp; &amp;nbsp; Startdate2&amp;nbsp; &amp;nbsp; &amp;nbsp;Enddate2 StartDate3 EndDate3...StartDate20 Enddate20&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;XXXXXX&amp;nbsp; &amp;nbsp; &amp;nbsp;01Jun2013&amp;nbsp; 30Jul2015&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;XXXXXX&amp;nbsp; &amp;nbsp; &amp;nbsp;01Aug2015 31Dec2016&amp;nbsp; &amp;nbsp;01Feb2017&amp;nbsp; &amp;nbsp; 01Sep2017&lt;/P&gt;&lt;P&gt;&amp;nbsp;XXXXXX&amp;nbsp; &amp;nbsp; &amp;nbsp;15Jan2012&amp;nbsp; 15Dec2017&lt;/P&gt;&lt;P&gt;&amp;nbsp;XXXXXX&amp;nbsp; &amp;nbsp; &amp;nbsp;01Jan2014&amp;nbsp; 01May2014&amp;nbsp; 15June2014&amp;nbsp; 15Aug2016&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to determine 6 months of continuous enrollment with an allowable gap of 45 days during a two year measure period, lets say Jan 01 2015-Dec 31, 2017. There is no anchor date. So essentially, I want to check all enrollment dates between Jan 01 2015 and December 31st 2017 and see if they have at least 6 months of continuous enrollment.&amp;nbsp;I'm not sure how to approach this when there are multiple start and end dates. Does anyone have any suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 04:33:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determining-continuous-enrollment-for-6-months/m-p/408947#M279503</guid>
      <dc:creator>Sam_I_am</dc:creator>
      <dc:date>2017-10-31T04:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Determining continuous enrollment for 6 months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determining-continuous-enrollment-for-6-months/m-p/408950#M279504</link>
      <description>&lt;P&gt;Post some more example data &lt;U&gt;&lt;STRONG&gt;and the corresponding expected output.&lt;/STRONG&gt;&lt;/U&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you search on here, it's been answered multiple times, but with a different data structure, a long rather than wide data set.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 00:26:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determining-continuous-enrollment-for-6-months/m-p/408950#M279504</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-31T00:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Determining continuous enrollment for 6 months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determining-continuous-enrollment-for-6-months/m-p/410173#M279505</link>
      <description>&lt;P&gt;Something like this may work (not tested):&lt;/P&gt;&lt;PRE&gt;data want;
  set have;
  array startdates startdate1-startdate20;
  array enddates enddate1-enddate20;&lt;BR /&gt;  enrolled=0;
  do _N_=1 to dim(startdates); /* find first enrollment within interval */&lt;BR /&gt;    if '01jan2015'd&amp;lt;=enddates(_N_)&amp;lt;='31dec2017'd or&lt;BR /&gt;       '01jan2015'd&amp;lt;=startdates(_N_)&amp;lt;='31dec2017'd&lt;BR /&gt;       then do;
      enroll_from=max(startdates(_N_),'01jan2015'd);&lt;BR /&gt;      enroll_to=min(enddates(_N_),'31dec2017'd);&lt;BR /&gt;      enrolled=intck('month',enroll_from,enroll_to,'C')&amp;gt;=6;&lt;BR /&gt;      leave;&lt;BR /&gt;      end;&lt;BR /&gt;    end;&lt;BR /&gt;  do _N_=_N_+1 to dim(startdates) while(not enrolled);&lt;BR /&gt;    if startdates(_N_)&amp;gt;'31dec20017'd then&lt;BR /&gt;      leave;&lt;BR /&gt;    if startdates(_N_)-enroll_to&amp;gt;45 then&lt;BR /&gt;      enroll_from=startdates(_N_);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; enroll_to=min(enddates(_N_),'31dec2017'd);&lt;BR /&gt; &amp;nbsp;&amp;nbsp; enrolled=intck('month',enroll_from,enroll_to,'C')&amp;gt;=6;&lt;BR /&gt;    end;&lt;BR /&gt;  drop enroll_from enroll_to;&lt;BR /&gt;run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Nov 2017 11:15:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determining-continuous-enrollment-for-6-months/m-p/410173#M279505</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2017-11-03T11:15:59Z</dc:date>
    </item>
  </channel>
</rss>

