<?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: how do i get the below output in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Add-End-Date-to-previous-record/m-p/579003#M164306</link>
    <description>&lt;P&gt;Are you sure this is the output you want? As I see it, you fetch the Start_Date of the screening for pt 102 as the end_date for the followup for pt 101? I don't think this is desirable?&lt;/P&gt;</description>
    <pubDate>Sun, 04 Aug 2019 13:46:25 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-08-04T13:46:25Z</dc:date>
    <item>
      <title>Add End Date to previous record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-End-Date-to-previous-record/m-p/579001#M164304</link>
      <description>&lt;P&gt;output-&lt;/P&gt;
&lt;P&gt;pt&amp;nbsp; &amp;nbsp; &amp;nbsp;element&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Start_date&amp;nbsp; &amp;nbsp; &amp;nbsp; end_date&lt;/P&gt;
&lt;P&gt;101 screening&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2017-02-10&amp;nbsp; &amp;nbsp;2017-02-24&lt;BR /&gt;101 randomization 2017-02-24&amp;nbsp; &amp;nbsp;2017-03-05&lt;BR /&gt;101 treatment&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2017-03-05&amp;nbsp; &amp;nbsp;2017-09 -23&lt;BR /&gt;101 followup&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2017-09-23&amp;nbsp; &amp;nbsp;2017-02-12&lt;/P&gt;
&lt;P&gt;102 screening&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2017-02-12&amp;nbsp; &amp;nbsp;2017-02-22&lt;BR /&gt;102 randomization 2017-02-22&amp;nbsp; &amp;nbsp;2017-03-10&lt;BR /&gt;102 treatment&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2017-03-10&amp;nbsp; &amp;nbsp;2017-09-20&lt;BR /&gt;102 followup&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2017-09-20&amp;nbsp; &amp;nbsp;2017-09-20&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;data raw (rename= (visit= ELEMENT));&lt;BR /&gt;input pt visit$9. STDT: is8601da.;&lt;BR /&gt;format STDT is8601da.;&lt;BR /&gt;datalines;&lt;BR /&gt;101 screening&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2017-02-10&lt;BR /&gt;101 randomization 2017-02-24&lt;BR /&gt;101 treatment&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2017-03-05&lt;BR /&gt;101 followup&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2017-09-23&amp;nbsp;&lt;/P&gt;
&lt;P&gt;102 screening&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2017-02-12&amp;nbsp; &amp;nbsp;&lt;BR /&gt;102 randomization 2017-02-22&amp;nbsp; &amp;nbsp;&lt;BR /&gt;102 treatment&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2017-03-10&amp;nbsp; &amp;nbsp;&lt;BR /&gt;102 followup&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2017-09-20&amp;nbsp; &amp;nbsp;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Aug 2019 17:34:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-End-Date-to-previous-record/m-p/579001#M164304</guid>
      <dc:creator>Mounika2</dc:creator>
      <dc:date>2019-08-04T17:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the below output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-End-Date-to-previous-record/m-p/579003#M164306</link>
      <description>&lt;P&gt;Are you sure this is the output you want? As I see it, you fetch the Start_Date of the screening for pt 102 as the end_date for the followup for pt 101? I don't think this is desirable?&lt;/P&gt;</description>
      <pubDate>Sun, 04 Aug 2019 13:46:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-End-Date-to-previous-record/m-p/579003#M164306</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-08-04T13:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: how do i get the below output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-End-Date-to-previous-record/m-p/579005#M164308</link>
      <description>&lt;P&gt;I think this is what you want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data raw (rename= (visit= ELEMENT));
input pt visit :$13. STDT: is8601da.;
format STDT is8601da.;
datalines;
101 screening 2017-02-10
101 randomization 2017-02-24
101 treatment 2017-03-05
101 followup 2017-09-23 
102 screening 2017-02-12 
102 randomization 2017-02-22 
102 treatment 2017-03-10 
102 followup 2017-09-20 
run;

data want;
   merge raw(rename=STDT=start_date) raw(firstobs=2 rename=STDT=end_date keep=STDT);
   if ELEMENT='followup' then end_date=start_date;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 04 Aug 2019 13:51:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-End-Date-to-previous-record/m-p/579005#M164308</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-08-04T13:51:28Z</dc:date>
    </item>
  </channel>
</rss>

