<?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 How to get date from previous row and add days to it. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-date-from-previous-row-and-add-days-to-it/m-p/549459#M152463</link>
    <description>&lt;P&gt;data temp3;&lt;BR /&gt;input @1 grp 1. @5 dt yymmdd10.;&lt;BR /&gt;format dt date10.;&lt;BR /&gt;datalines;&lt;BR /&gt;1 2019-03-11&lt;BR /&gt;2 2018-12-15&lt;BR /&gt;2 .&lt;BR /&gt;2 .&lt;BR /&gt;3 2018-12-28&lt;BR /&gt;3 .&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone let me know how to get the missing values populated with previous date+5 days in the particular group.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example in the group 2,&amp;nbsp; I want to see the below result.&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; 2018-12-15&lt;BR /&gt;2&amp;nbsp; &amp;nbsp; 2018-12-20&lt;BR /&gt;2&amp;nbsp; &amp;nbsp; 2018-12-25&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2019 01:49:33 GMT</pubDate>
    <dc:creator>shari</dc:creator>
    <dc:date>2019-04-09T01:49:33Z</dc:date>
    <item>
      <title>How to get date from previous row and add days to it.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-date-from-previous-row-and-add-days-to-it/m-p/549459#M152463</link>
      <description>&lt;P&gt;data temp3;&lt;BR /&gt;input @1 grp 1. @5 dt yymmdd10.;&lt;BR /&gt;format dt date10.;&lt;BR /&gt;datalines;&lt;BR /&gt;1 2019-03-11&lt;BR /&gt;2 2018-12-15&lt;BR /&gt;2 .&lt;BR /&gt;2 .&lt;BR /&gt;3 2018-12-28&lt;BR /&gt;3 .&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone let me know how to get the missing values populated with previous date+5 days in the particular group.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example in the group 2,&amp;nbsp; I want to see the below result.&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; 2018-12-15&lt;BR /&gt;2&amp;nbsp; &amp;nbsp; 2018-12-20&lt;BR /&gt;2&amp;nbsp; &amp;nbsp; 2018-12-25&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 01:49:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-date-from-previous-row-and-add-days-to-it/m-p/549459#M152463</guid>
      <dc:creator>shari</dc:creator>
      <dc:date>2019-04-09T01:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get date from previous row and add days to it.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-date-from-previous-row-and-add-days-to-it/m-p/549460#M152464</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp3;
infile cards truncover;
input @1 grp 1. @5 dt yymmdd10.;
format dt date10.;
datalines;
1 2019-03-11
2 2018-12-15
2 .
2 .
3 2018-12-28
3 .
;

data want;
set temp3;
by grp;
retain _dt;
if not missing(dt) or first.grp then _dt=dt;
else if missing(dt) then do; dt=_dt+5;_dt=dt;end;
drop _dt;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Apr 2019 02:11:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-date-from-previous-row-and-add-days-to-it/m-p/549460#M152464</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-04-09T02:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get date from previous row and add days to it.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-date-from-previous-row-and-add-days-to-it/m-p/549465#M152467</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 03:36:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-date-from-previous-row-and-add-days-to-it/m-p/549465#M152467</guid>
      <dc:creator>shari</dc:creator>
      <dc:date>2019-04-09T03:36:21Z</dc:date>
    </item>
  </channel>
</rss>

