<?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: create a flag for each month policy is active in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-a-flag-for-each-month-policy-is-active/m-p/767663#M243409</link>
    <description>&lt;P&gt;So you want to check for only 13 months, even if the policy runs for a longer term?&lt;/P&gt;
&lt;P&gt;How many months should be checked if the end date is missing and 13 months from the start date would be in the future?&lt;/P&gt;</description>
    <pubDate>Tue, 14 Sep 2021 10:47:35 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-09-14T10:47:35Z</dc:date>
    <item>
      <title>create a flag for each month policy is active</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-flag-for-each-month-policy-is-active/m-p/767634#M243396</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;I have a dataset with policies date began between 2018-01-01 and 2019-12-31 (2 years) that has the following info:&lt;/P&gt;&lt;PRE&gt;policy          policy_beg_date	   policy_end_date
a	           01-02-2018	    06-02-2018
b	           04-02-2019	    02-04-2020
c	           23-12-2019	    03-02-2020
d	           02-02-2019	&lt;/PRE&gt;&lt;P&gt;policy begining date (date that policy started) and policy end date (date that policy ended - is missing if policy is still active)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create flags of 13 months (flag_0month, flag_1month,....flag_13month) where i give 1 if policy is active in month 0, month1, and so on....where month0 is the month of beginnig, month1 is month of begining + 1 and so on so i would have something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;policy          policy_beg_date	   policy_end_date	month_begining	 month_end	act_month0	act_month1	act_month2
a	            01-01-2018	      06-01-2018	   201801	   201801	   1		
b	            04-02-2019	      02-04-2020	   201902	   202003	   1	             1	            1
c	            23-12-2019	      03-02-2020	   201912	   202002	   1	             1	            1
d	            02-02-2019		                   201902		           1	             1         	    1&lt;/PRE&gt;&lt;P&gt;Can anyone please help me achivieng this?&lt;/P&gt;&lt;P&gt;I already tryied someting like in this post :&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/How-to-create-a-flag-for-each-month-lying-between-2-dates/td-p/433331" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Programming/How-to-create-a-flag-for-each-month-lying-between-2-dates/td-p/433331&lt;/A&gt;&amp;nbsp;but i get errors and i think it's not the same as i need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 09:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-flag-for-each-month-policy-is-active/m-p/767634#M243396</guid>
      <dc:creator>msf2021</dc:creator>
      <dc:date>2021-09-14T09:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: create a flag for each month policy is active</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-flag-for-each-month-policy-is-active/m-p/767663#M243409</link>
      <description>&lt;P&gt;So you want to check for only 13 months, even if the policy runs for a longer term?&lt;/P&gt;
&lt;P&gt;How many months should be checked if the end date is missing and 13 months from the start date would be in the future?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 10:47:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-flag-for-each-month-policy-is-active/m-p/767663#M243409</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-14T10:47:35Z</dc:date>
    </item>
  </channel>
</rss>

