<?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 continuous enrollment counting in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193931#M36452</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SAS community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to identify the individuals who have been continuously enrolled beginning from their start date to either end of study (12/31/2015) or date of event. It is possible for a subject to be enrolled prior to the start date. However, I do not want to count the months before the listed start date .Please advise on suggested coding tips.&amp;nbsp; Below is a simplified version of the dataset.&amp;nbsp; Using this example, the Individuals who meet the criteria, include AA, BB, EE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input SubID startdate eventdate enddate mon1 mon2 mon3 mon4 mon5 mon6 mon7 mon8 mon9 mon10 mon11 mon12;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;AA 03/10/2015 . 12/31/2015 . . 1 1 1 1 1 1 1 1 1 1&lt;/P&gt;&lt;P&gt;BB 05/20/2015 08/02/2015 12/31/2015 . . . 1 1 1 1 1 1 1 1 1&lt;/P&gt;&lt;P&gt;CC 01/18/2015 . 12/31/2015 1 1 1 1 . . . . . 1 . .&lt;/P&gt;&lt;P&gt;DD 08/01/2015 . 12/31/2015 . . . . . . 1 1 . 1 &lt;/P&gt;&lt;P&gt;EE 02/25/2015 . 05/11/2015 12/31/2015 . 1 1 1 1 1 1 1 1 . . 1;&lt;/P&gt;&lt;P&gt;FF 04/09/2015 11/10/2015 12/31/2015 . 1 1 1 1 . 1 1 1 1 1 . &lt;/P&gt;&lt;P&gt;;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Aug 2015 15:34:33 GMT</pubDate>
    <dc:creator>sophia_SAS</dc:creator>
    <dc:date>2015-08-06T15:34:33Z</dc:date>
    <item>
      <title>continuous enrollment counting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193931#M36452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SAS community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to identify the individuals who have been continuously enrolled beginning from their start date to either end of study (12/31/2015) or date of event. It is possible for a subject to be enrolled prior to the start date. However, I do not want to count the months before the listed start date .Please advise on suggested coding tips.&amp;nbsp; Below is a simplified version of the dataset.&amp;nbsp; Using this example, the Individuals who meet the criteria, include AA, BB, EE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input SubID startdate eventdate enddate mon1 mon2 mon3 mon4 mon5 mon6 mon7 mon8 mon9 mon10 mon11 mon12;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;AA 03/10/2015 . 12/31/2015 . . 1 1 1 1 1 1 1 1 1 1&lt;/P&gt;&lt;P&gt;BB 05/20/2015 08/02/2015 12/31/2015 . . . 1 1 1 1 1 1 1 1 1&lt;/P&gt;&lt;P&gt;CC 01/18/2015 . 12/31/2015 1 1 1 1 . . . . . 1 . .&lt;/P&gt;&lt;P&gt;DD 08/01/2015 . 12/31/2015 . . . . . . 1 1 . 1 &lt;/P&gt;&lt;P&gt;EE 02/25/2015 . 05/11/2015 12/31/2015 . 1 1 1 1 1 1 1 1 . . 1;&lt;/P&gt;&lt;P&gt;FF 04/09/2015 11/10/2015 12/31/2015 . 1 1 1 1 . 1 1 1 1 1 . &lt;/P&gt;&lt;P&gt;;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 15:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193931#M36452</guid>
      <dc:creator>sophia_SAS</dc:creator>
      <dc:date>2015-08-06T15:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: continuous enrollment counting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193932#M36453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do mon1 mon2 represent, how are they derived?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you determine/define continuous enrollment?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 15:46:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193932#M36453</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-08-06T15:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: continuous enrollment counting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193933#M36454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also provide an example of what you want the output to look like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 15:48:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193933#M36454</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-08-06T15:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: continuous enrollment counting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193934#M36455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reeza and Ballardw for your questions. See my responses to your questions.&amp;nbsp; Let me know if I should clarify further!&amp;nbsp; Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;What do mon1 mon2 represent, how are they derived?&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;mon1, mon2, . . . mon12 = the months in 2013 where mon1 = Jan 2013, mon2 = Feb 2013 ... mon12=Dec 2013.&amp;nbsp; 1 = enrolled; . = not enrolled.&lt;/P&gt;&lt;P&gt;For example, subject AA was enrolled from mon3-mon12 or from March 2013 to Dec 2013. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2. How do you determine/define continuous enrollment?&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Continuous enrollment is define by enrollment (i.e. value=1) for at least 1 day in every month from start date to end date or date of event. For example, Subject AA was continuously enrolled for the defined period because there is a 1 from Mon3-Mon12 and AA start date is 3/10/2015 (Mon3) and end date is 12/31/2015 (Mon12).&amp;nbsp; In contrast, Subject CC was not continuously enrolled for the desired time frame because CC &lt;SPAN style="font-size: 13.3333330154419px;"&gt;had start date and end dates from Jan 2013-Dec 2013&lt;/SPAN&gt; and was not enrolled in mon5-mon9, and mon11-mon12.&lt;/P&gt;&lt;P&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;EM&gt;3. Provide an example of what you want the output to look like.&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Ideally, the output will contain at least 2 new variables: eligible (i.e. met the continuously enrollment criteria) and if yes, the sum of months from start to end or start to event.&amp;nbsp; For example, see the same dataset below with two new variables. &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 style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data want;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;input SubID startdate eventdate enddate mon1 mon2 mon3 mon4 mon5 mon6 mon7 mon8 mon9 mon10 mon11 mon12 eligible sum_months;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;datalines;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;AA 03/10/2015 . 12/31/2015 . . 1 1 1 1 1 1 1 1 1 1 yes 10&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;BB 05/20/2015 08/02/2015 12/31/2015 . . . 1 1 1 1 1 1 1 1 1 yes 4&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;CC 01/18/2015 . 12/31/2015 1 1 1 1 . . . . . 1 . . no . &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;DD 08/01/2015 . 12/31/2015 . . . . . . 1 1 . 1 no . &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;EE 02/25/2015 . 05/11/2015 12/31/2015 . 1 1 1 1 1 1 1 1 . . 1 yes 4&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;FF 04/09/2015 11/10/2015 12/31/2015 . 1 1 1 1 . 1 1 1 1 1 . no .&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 16:14:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193934#M36455</guid>
      <dc:creator>sophia_SAS</dc:creator>
      <dc:date>2015-08-06T16:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: continuous enrollment counting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193935#M36456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I have a solution for you, let me know if this does it, first I got the applicable range, then made sure that your mon1-12 variable within that range was populated:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;infile datalines ;&lt;/P&gt;&lt;P&gt;informat subid $2. startdate eventdate enddate mmddyy10.;;&lt;/P&gt;&lt;P&gt;format subid $2. startdate eventdate enddate mmddyy10.;&lt;/P&gt;&lt;P&gt;input SubID$ startdate eventdate enddate mon1 mon2 mon3 mon4 mon5 mon6 mon7 mon8 mon9 mon10 mon11 mon12;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;AA 03/10/2015 . 12/31/2015 . . 1 1 1 1 1 1 1 1 1 1&lt;/P&gt;&lt;P&gt;BB 05/20/2015 08/02/2015 12/31/2015 . . . 1 1 1 1 1 1 1 1 1&lt;/P&gt;&lt;P&gt;CC 01/18/2015 . 12/31/2015 1 1 1 1 . . . . . 1 . .&lt;/P&gt;&lt;P&gt;DD 08/01/2015 . 12/31/2015 . . . . . . 1 1 . 1 . .&lt;/P&gt;&lt;P&gt;EE 02/25/2015 05/11/2015 12/31/2015 . 1 1 1 1 1 1 1 1 . . 1&lt;/P&gt;&lt;P&gt;FF 04/09/2015 11/10/2015 12/31/2015 . 1 1 1 1 . 1 1 1 1 1 . &lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data range;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;start = month(startdate);&lt;/P&gt;&lt;P&gt;if not missing(eventdate) then end = month(eventdate);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else end = month(enddate);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=range out=tran_range;by subid start end;var mon:;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data compress;&lt;/P&gt;&lt;P&gt;set tran_range;&lt;/P&gt;&lt;P&gt;where start &amp;lt;= input(compress(_NAME_,'a','l'),8.) &amp;lt;= end;&lt;/P&gt;&lt;P&gt;if missing(col1) then col1 = 0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select distinct subid,'Yes' as Eligible,end - start + 1 as sum_months&lt;/P&gt;&lt;P&gt;from compress&lt;/P&gt;&lt;P&gt;group by subid&lt;/P&gt;&lt;P&gt;having min(col1) = 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data final;&lt;/P&gt;&lt;P&gt;merge want(in=a)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; have(in=b);&lt;/P&gt;&lt;P&gt;by subid;&lt;/P&gt;&lt;P&gt;if b;&lt;/P&gt;&lt;P&gt;if b and not a then Eligible = 'No';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Mark Johnson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 16:34:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193935#M36456</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-08-06T16:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: continuous enrollment counting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193936#M36457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your solution works great.&amp;nbsp; Thank you for your time!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One other follow-up question. I actually have multiple years of data that I'm working with so my start and end dates frequently have different years.&amp;nbsp; For example, subject MM start date= 06/05/2013 and end date = 12/31/2015.&amp;nbsp; Do you have a suggestion on how to work with those differences?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 17:21:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193936#M36457</guid>
      <dc:creator>sophia_SAS</dc:creator>
      <dc:date>2015-08-06T17:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: continuous enrollment counting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193937#M36458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do your variables look like, var1 var2?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 17:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193937#M36458</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-08-06T17:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: continuous enrollment counting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193938#M36459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm sorry for not mentioning the multiple years of data.&amp;nbsp; I was trying to simplify things . . . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for your question, the only difference in my variables is how the months are labeled.&amp;nbsp; There are actually 36 months with Mon1=Jan 2013 and Mon36=Dec2015 everything else is the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 18:01:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193938#M36459</guid>
      <dc:creator>sophia_SAS</dc:creator>
      <dc:date>2015-08-06T18:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: continuous enrollment counting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193939#M36460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark! I figured out a solution! &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thanks again!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 19:15:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/continuous-enrollment-counting/m-p/193939#M36460</guid>
      <dc:creator>sophia_SAS</dc:creator>
      <dc:date>2015-08-06T19:15:14Z</dc:date>
    </item>
  </channel>
</rss>

