<?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: Insurance Exposure Over 12 month periods in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Insurance-Exposure-Over-12-month-periods/m-p/720633#M223239</link>
    <description>&lt;P&gt;1) It seems to me you missed to RETAIN the lag(dates):&amp;nbsp;&lt;SPAN&gt;Inception_date,&amp;nbsp;Supposed_end&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2) may I propose different approach:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; -&amp;nbsp; &amp;nbsp;compute number of months &lt;STRONG&gt;per line&lt;/STRONG&gt;:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;months = intck('month', &amp;lt;end of coverage date&amp;gt;,&amp;lt;start of coverage date&amp;gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; - accumulate the computed months &lt;STRONG&gt;per ID&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; - check whether&amp;nbsp;the accumulated months &amp;gt;= 12 and last month is equal to &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;the supposed end date.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3) You mentioned there may be &lt;STRONG&gt;gaps&lt;/STRONG&gt;, but you did not gave the rule how to relate&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;to the gap.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 20 Feb 2021 10:08:29 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2021-02-20T10:08:29Z</dc:date>
    <item>
      <title>Insurance Exposure Over 12 month periods</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insurance-Exposure-Over-12-month-periods/m-p/720629#M223236</link>
      <description>&lt;P&gt;Hello everyone! The coverage for an insurance product i'm dealing with could be paid in upfront from 1-12 months. For example, in the picture below, the first person had bought seven consecutive one month policies and the second guy has bought a 3 months policy followed by a 9 months policy (there could be gaps)(first column - ID, Second column gender(irrelevant), third column - start of coverage date, fourth column - end of coverage date).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tharan_2-1613810496430.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54976i5B2389D20881D53D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tharan_2-1613810496430.png" alt="tharan_2-1613810496430.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now I want to find someone who has paid for 12 months worth of coverage (regardless of how, could be 12 month in one go, 3+3+3+3 combination etc) and has proceeded with another 12 months worth of coverage. This is the solution I came up with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data workone.testingrenewal4;&lt;BR /&gt;Set workone.sorted2;&lt;/P&gt;&lt;P&gt;Format Inception_date Supposed_end date1 date2 date9.;&lt;/P&gt;&lt;P&gt;date1 = lag(Inception_date);&lt;BR /&gt;date2 = lag(Supposed_end);&lt;/P&gt;&lt;P&gt;By ic;&lt;/P&gt;&lt;P&gt;If first.ic then do;&lt;BR /&gt;Inception_date = Startdate;&lt;BR /&gt;Supposed_end = (INTNX('YEAR', startdate ,1, 'sameday')-1);&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;else if date1&amp;lt;startdate&amp;lt;date2 then do;&lt;BR /&gt;Inception_date = date1;&lt;BR /&gt;Supposed_end = date2;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;else if startdate&amp;gt;=date2 then do;&lt;BR /&gt;Inception_date = Startdate;&lt;BR /&gt;Supposed_end = (INTNX('YEAR', startdate ,1, 'sameday')-1);&lt;BR /&gt;End;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;essentially i want the codes to identify the first time a person has contributed and build a 12 month period using the startdate where the start of the 12 month coverage would =startdate (called Inception_date) and the end of the coverage would be 12 months from startdate (called supposed_end). If its not the first payment under the person then i want to observe whether the following payment was made within the 12 months period previously built. If yes, then I want the codes to assign the same Inception_date and supposed_end dates to the dataline. If the person had bought coverage after the pervious 12 months perios, then i want the codes to assign a new inception date based on the startdate of the newly purchased coverage.&amp;nbsp; With that I'd be able to count the number of months in each built 12 month period.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The results are not coming out like how i want them and I'm kinda new to SAS programming, so would appreciate if anyone can help improve the codes. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2021 08:56:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insurance-Exposure-Over-12-month-periods/m-p/720629#M223236</guid>
      <dc:creator>tharan</dc:creator>
      <dc:date>2021-02-20T08:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Insurance Exposure Over 12 month periods</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insurance-Exposure-Over-12-month-periods/m-p/720633#M223239</link>
      <description>&lt;P&gt;1) It seems to me you missed to RETAIN the lag(dates):&amp;nbsp;&lt;SPAN&gt;Inception_date,&amp;nbsp;Supposed_end&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2) may I propose different approach:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; -&amp;nbsp; &amp;nbsp;compute number of months &lt;STRONG&gt;per line&lt;/STRONG&gt;:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;months = intck('month', &amp;lt;end of coverage date&amp;gt;,&amp;lt;start of coverage date&amp;gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; - accumulate the computed months &lt;STRONG&gt;per ID&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; - check whether&amp;nbsp;the accumulated months &amp;gt;= 12 and last month is equal to &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;the supposed end date.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3) You mentioned there may be &lt;STRONG&gt;gaps&lt;/STRONG&gt;, but you did not gave the rule how to relate&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;to the gap.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2021 10:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insurance-Exposure-Over-12-month-periods/m-p/720633#M223239</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-02-20T10:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Insurance Exposure Over 12 month periods</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insurance-Exposure-Over-12-month-periods/m-p/720640#M223245</link>
      <description>&lt;P&gt;How do you want to deal with a situation where the end of a 12-month period falls right into an insured period?&lt;/P&gt;
&lt;P&gt;E.g. 3 months, immediately followed by 12 months. Should the 12 months be split into 9 months, completing the first 12, and 3 months, the start of a (possible) new 12-month period?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 08:21:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insurance-Exposure-Over-12-month-periods/m-p/720640#M223245</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-25T08:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Insurance Exposure Over 12 month periods</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insurance-Exposure-Over-12-month-periods/m-p/721728#M223729</link>
      <description>Hi Kurt, your example is correct. By the looks of it seems like I'd have to split each payment by the coverage months before compiling them back into 12 month periods before trying to identify possible '12months renewals' thanks for pointing it out. Will have to bring this back to the table.</description>
      <pubDate>Thu, 25 Feb 2021 01:44:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insurance-Exposure-Over-12-month-periods/m-p/721728#M223729</guid>
      <dc:creator>tharan</dc:creator>
      <dc:date>2021-02-25T01:44:23Z</dc:date>
    </item>
  </channel>
</rss>

