<?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: Continuous Enrollment for 18 months from 2015 to 2016 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Continuous-Enrollment-for-18-months-from-2015-to-2016/m-p/327509#M62398</link>
    <description>&lt;P&gt;Thank you so much! It worked!&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2017 19:38:02 GMT</pubDate>
    <dc:creator>ssitharath0420</dc:creator>
    <dc:date>2017-01-25T19:38:02Z</dc:date>
    <item>
      <title>Continuous Enrollment for 18 months from 2015 to 2016</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Continuous-Enrollment-for-18-months-from-2015-to-2016/m-p/327457#M62395</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to figure what is the bast way to determine&amp;nbsp;the members that have a continuous enollement from 01/25/2017 for 18 months.&amp;nbsp; I used the lag function and was able to calculate their start of the coverage and the term of the coverage.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The orginal table contains this data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Patid Drug_Cov Drug_term&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01Jan2014&amp;nbsp; 31Dec2014&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01Jan2015&amp;nbsp; 31Dec2015&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01Jan2016&amp;nbsp;&amp;nbsp;&amp;nbsp;31Dec2016&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01Jan2017&amp;nbsp;&amp;nbsp; 01Jan3000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01Jan2015&amp;nbsp; 31Dec2014&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01Jan2016&amp;nbsp; 31Dec2015&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01Jan201&amp;nbsp;&amp;nbsp;&amp;nbsp;01Jan3000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01Feb2015&amp;nbsp; 11May2015&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12May2015&amp;nbsp;&amp;nbsp; 31Oct2015&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the lag function to determine the continuous the drug coverage and drug term date:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the lag function, this is the table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Patid&amp;nbsp;&amp;nbsp;&amp;nbsp; Drug_Cov&amp;nbsp; Drug_Term&lt;/P&gt;&lt;P&gt;1&amp;nbsp; 01Jan2014 01Jan3000&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp; 01Jan2015&amp;nbsp; 01Jan3000&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp; 01Feb2015&amp;nbsp;&amp;nbsp; 31Oct2015&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I now determine the members that has an 18 months continuous enrollent from today date?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 17:34:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Continuous-Enrollment-for-18-months-from-2015-to-2016/m-p/327457#M62395</guid>
      <dc:creator>ssitharath0420</dc:creator>
      <dc:date>2017-01-25T17:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Continuous Enrollment for 18 months from 2015 to 2016</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Continuous-Enrollment-for-18-months-from-2015-to-2016/m-p/327497#M62396</link>
      <description>&lt;P&gt;What do your mean by "18 months continuous enrollent from today date"?&amp;nbsp;&amp;nbsp;Currently active with a starting data at least 18 months ago?&amp;nbsp; That's what I assume.&amp;nbsp; The following program should do (I had to correct two of your data entries?):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input Patid Drug_Cov :date9. Drug_term :date9. ;
  format drug_cov drug_term $date9.;
datalines;
1        01Jan2014  31Dec2014
1        01Jan2015  31Dec2015
1        01Jan2016   31Dec2016
1        01Jan2017  01Jan3000
2        01Jan2015  31Dec2014
2        01Jan2015  31Dec2015    /* change 01jan2016 to 01jan2015*/
2        01Jan2016  01Jan3000    /* change 01jan201  to 01jan2016*/
3        01Feb2015  11May2015
3        12May2015  31Oct2015
run;

data spells (drop=next_cov first_cov);
  set have (keep=patid);
  by patid ;
  retain first_cov;
  merge have
        have (firstobs=2 keep=drug_cov rename=(drug_cov=next_cov));

  /* if this is beginning-of-spell, set first_cov value*/
  if first.patid or drug_cov-1 &amp;gt; lag(drug_term) then first_cov=drug_cov;

  /* See if at end-of-spell and whether its date range qualifies*/
  if last.patid   or next_cov &amp;gt; drug_term + 1 then do;
    drug_cov=first_cov;     
    if drug_term&amp;gt;=today() and intck('month',drug_cov,today()+1,'continuous')&amp;gt;=18 then output;
  end;                            
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "continuous" argument of the INTCK function says not to count calendar month boudaries, but rather use the actual date of drug_cov vs today as a way to count months.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 19:18:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Continuous-Enrollment-for-18-months-from-2015-to-2016/m-p/327497#M62396</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-01-25T19:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Continuous Enrollment for 18 months from 2015 to 2016</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Continuous-Enrollment-for-18-months-from-2015-to-2016/m-p/327509#M62398</link>
      <description>&lt;P&gt;Thank you so much! It worked!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 19:38:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Continuous-Enrollment-for-18-months-from-2015-to-2016/m-p/327509#M62398</guid>
      <dc:creator>ssitharath0420</dc:creator>
      <dc:date>2017-01-25T19:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Continuous Enrollment for 18 months from 2015 to 2016</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Continuous-Enrollment-for-18-months-from-2015-to-2016/m-p/459770#M70270</link>
      <description>&lt;P&gt;Hi there, how did you create your output dataset using lag and retain function to get continous enrollment ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 17:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Continuous-Enrollment-for-18-months-from-2015-to-2016/m-p/459770#M70270</guid>
      <dc:creator>manya92</dc:creator>
      <dc:date>2018-05-03T17:48:39Z</dc:date>
    </item>
  </channel>
</rss>

