<?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 Index Date Truncation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Index-Date-Truncation/m-p/647146#M193641</link>
    <description>&lt;PRE&gt;data have;
infile datalines missover; 
   input IDnumber @3 date  mmddyy10.;
   datalines;  
1 4-7-2003 
1 4-7-2009 
1 4-7-2010 
1 4-7-2011 
1 4-7-2012 
1 4-7-2013 
1 4-7-2014 
1 4-7-2015 
1 4-7-2016 
1 4-7-2018 
2 4-7-2005 
2 4-7-2011 
2 4-7-2012 
2 4-7-2013 
2 4-7-2014 
2 4-7-2015 
2 4-7-2016 
2 4-7-2017 
2 4-7-2018 
2 4-7-2019 
2 4-7-2020 
;       
run; &lt;/PRE&gt;&lt;PRE&gt;data want;
infile datalines missover; 
   input IDnumber @3 date  mmddyy10. @12 index_date  mmddyy10.;
   datalines;  
1 4-7-2003  4-7-2003
1 4-7-2009  4-7-2009
1 4-7-2010  4-7-2009
1 4-7-2011  4-7-2009
1 4-7-2012 4-7-2009
1 4-7-2013 4-7-2009
1 4-7-2014 4-7-2014
1 4-7-2015 4-7-2014
1 4-7-2016 4-7-2014
1 4-7-2018 4-7-2014
2 4-7-2005 4-7-2005
2 4-7-2011 4-7-2011
2 4-7-2012 4-7-2011
2 4-7-2013 4-7-2011
2 4-7-2014 4-7-2011
2 4-7-2015 4-7-2011
2 4-7-2016 4-7-2016
2 4-7-2017  4-7-2016
2 4-7-2018  4-7-2016
2 4-7-2019  4-7-2016
2 4-7-2020  4-7-2016
;       
run; &lt;/PRE&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have data with the different dates by grouping variable "IDnumber". I have calculated index date based on the condition, if first "idnumber" or the difference between current date and lag(date) is greater than 4 years. What i need is to repeat the index date until new index date within the same group. For example the index date on the second line will be repeated untill line number seven.&lt;/P&gt;</description>
    <pubDate>Tue, 12 May 2020 16:12:12 GMT</pubDate>
    <dc:creator>ifti_ch2002</dc:creator>
    <dc:date>2020-05-12T16:12:12Z</dc:date>
    <item>
      <title>Index Date Truncation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-Date-Truncation/m-p/647146#M193641</link>
      <description>&lt;PRE&gt;data have;
infile datalines missover; 
   input IDnumber @3 date  mmddyy10.;
   datalines;  
1 4-7-2003 
1 4-7-2009 
1 4-7-2010 
1 4-7-2011 
1 4-7-2012 
1 4-7-2013 
1 4-7-2014 
1 4-7-2015 
1 4-7-2016 
1 4-7-2018 
2 4-7-2005 
2 4-7-2011 
2 4-7-2012 
2 4-7-2013 
2 4-7-2014 
2 4-7-2015 
2 4-7-2016 
2 4-7-2017 
2 4-7-2018 
2 4-7-2019 
2 4-7-2020 
;       
run; &lt;/PRE&gt;&lt;PRE&gt;data want;
infile datalines missover; 
   input IDnumber @3 date  mmddyy10. @12 index_date  mmddyy10.;
   datalines;  
1 4-7-2003  4-7-2003
1 4-7-2009  4-7-2009
1 4-7-2010  4-7-2009
1 4-7-2011  4-7-2009
1 4-7-2012 4-7-2009
1 4-7-2013 4-7-2009
1 4-7-2014 4-7-2014
1 4-7-2015 4-7-2014
1 4-7-2016 4-7-2014
1 4-7-2018 4-7-2014
2 4-7-2005 4-7-2005
2 4-7-2011 4-7-2011
2 4-7-2012 4-7-2011
2 4-7-2013 4-7-2011
2 4-7-2014 4-7-2011
2 4-7-2015 4-7-2011
2 4-7-2016 4-7-2016
2 4-7-2017  4-7-2016
2 4-7-2018  4-7-2016
2 4-7-2019  4-7-2016
2 4-7-2020  4-7-2016
;       
run; &lt;/PRE&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have data with the different dates by grouping variable "IDnumber". I have calculated index date based on the condition, if first "idnumber" or the difference between current date and lag(date) is greater than 4 years. What i need is to repeat the index date until new index date within the same group. For example the index date on the second line will be repeated untill line number seven.&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 16:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-Date-Truncation/m-p/647146#M193641</guid>
      <dc:creator>ifti_ch2002</dc:creator>
      <dc:date>2020-05-12T16:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Index Date Truncation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-Date-Truncation/m-p/647153#M193646</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I have calculated index date based on the condition, if first "idnumber" &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;or the difference between current date and lag(date) is greater than 4 years&lt;/FONT&gt;&lt;/STRONG&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I don't see how the part in red is applied to obtain the desired result.&lt;BR /&gt;Why does index date change at 4-7-2014?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 16:38:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-Date-Truncation/m-p/647153#M193646</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-12T16:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Index Date Truncation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-Date-Truncation/m-p/647183#M193654</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;,&amp;nbsp;i accidently accepted the solution. Current date i mean if on the row second then the current date is on the second row. But this is not the question. Question is only to repeat the index date until new index date. Updated question is on the following&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Repeat-Index-Date/m-p/647182#M193653" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Repeat-Index-Date/m-p/647182#M193653&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 17:55:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-Date-Truncation/m-p/647183#M193654</guid>
      <dc:creator>ifti_ch2002</dc:creator>
      <dc:date>2020-05-12T17:55:17Z</dc:date>
    </item>
  </channel>
</rss>

