<?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: Roll up enrollment data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Roll-up-enrollment-data/m-p/490954#M128619</link>
    <description>&lt;P&gt;I just put them there for information purpose. It does not matter what's the value of the Coverage variable. It just shows that there could be some records with overlapping time period.&lt;/P&gt;</description>
    <pubDate>Wed, 29 Aug 2018 18:49:57 GMT</pubDate>
    <dc:creator>buszhangsy</dc:creator>
    <dc:date>2018-08-29T18:49:57Z</dc:date>
    <item>
      <title>Roll up enrollment data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Roll-up-enrollment-data/m-p/490943#M128616</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have monthly enrollment data from commercial and Medicare claims and would like to roll them up into continuous enrollment segments. Tricky part is that an individual can have overlap coverage (commercial+Medicare). I tried to create a date variable (i.e. 30&amp;nbsp;lines if monthly enrollment is Sep01 to Sep30) and check if dif(date)&amp;gt;1 for triggering discontinuation of&amp;nbsp;current enrollment. However, my data set gets extremely large (300B obs) and run time is several hours. I would appreciate if anyone could provide a much efficient approach to tackle this. An example of data input and desired output are shown below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data input&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PatientID&amp;nbsp; Start&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Coverage&lt;/P&gt;
&lt;P&gt;00001&amp;nbsp; &amp;nbsp; &amp;nbsp; 01/01/2018&amp;nbsp; &amp;nbsp; &amp;nbsp; 01/31/2018&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Commercial&lt;/P&gt;
&lt;P&gt;00001&amp;nbsp; &amp;nbsp; &amp;nbsp; 02/01/2018&amp;nbsp; &amp;nbsp; &amp;nbsp; 02/28/2018&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Commercial&lt;/P&gt;
&lt;P&gt;00001&amp;nbsp; &amp;nbsp; &amp;nbsp; 04/01/2018&amp;nbsp; &amp;nbsp; &amp;nbsp; 04/30/2018&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Commercial&lt;/P&gt;
&lt;P&gt;00001&amp;nbsp; &amp;nbsp; &amp;nbsp; 05/01/2018&amp;nbsp; &amp;nbsp; &amp;nbsp; 05/20/2018&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Commercial&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;00001&amp;nbsp; &amp;nbsp; &amp;nbsp; 05/15/2018&amp;nbsp; &amp;nbsp; &amp;nbsp; 05/31/2018&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Medicare&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Output&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PatientID&amp;nbsp; Start&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;00001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01/01/2018&amp;nbsp; &amp;nbsp; 02/28/2018&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;00001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;04/01/2018&amp;nbsp; &amp;nbsp; 05/31/2018&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 18:27:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Roll-up-enrollment-data/m-p/490943#M128616</guid>
      <dc:creator>buszhangsy</dc:creator>
      <dc:date>2018-08-29T18:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Roll up enrollment data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Roll-up-enrollment-data/m-p/490946#M128617</link>
      <description>&lt;P&gt;You need to show at least what happens with the Coverage variable values in this "roll up". Are there any other variables? What happens with them in the roll up?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 18:33:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Roll-up-enrollment-data/m-p/490946#M128617</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-29T18:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Roll up enrollment data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Roll-up-enrollment-data/m-p/490954#M128619</link>
      <description>&lt;P&gt;I just put them there for information purpose. It does not matter what's the value of the Coverage variable. It just shows that there could be some records with overlapping time period.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 18:49:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Roll-up-enrollment-data/m-p/490954#M128619</guid>
      <dc:creator>buszhangsy</dc:creator>
      <dc:date>2018-08-29T18:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Roll up enrollment data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Roll-up-enrollment-data/m-p/490994#M128642</link>
      <description>&lt;P&gt;Any help is appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 20:49:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Roll-up-enrollment-data/m-p/490994#M128642</guid>
      <dc:creator>buszhangsy</dc:creator>
      <dc:date>2018-08-29T20:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Roll up enrollment data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Roll-up-enrollment-data/m-p/491247#M128776</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input PatientID  Start   : mmddyy10.              End          : mmddyy10.  ;
format  Start    End    mmddyy10.;
cards;
00001      01/01/2018      01/31/2018         Commercial
00001      02/01/2018      02/28/2018         Commercial
00001      04/01/2018      04/30/2018         Commercial
00001      05/01/2018      05/20/2018         Commercial
00001      05/15/2018      05/31/2018         Medicare
;


data temp;
 set have;
 by PatientID ;
 dif=start-lag(end);
 if first.PatientID  then dif=.;
run;
data temp;
 set temp;
 by PatientID ;
 if dif &amp;gt;1 or first.PatientID then group+1;
run;
data want;
 set temp;
 by PatientID group;
 retain new_start;
 if first.group then new_start=start;
 if last.group then do;new_end=end;output;end;
 keep PatientID new_start new_end;
 format new_start new_end mmddyy10.;
run;

proc print;run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Aug 2018 14:07:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Roll-up-enrollment-data/m-p/491247#M128776</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-08-30T14:07:11Z</dc:date>
    </item>
  </channel>
</rss>

