<?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: LAST VALUE CARRY FORWARD in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637075#M189365</link>
    <description>Dear &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;,&lt;BR /&gt;the resulted data set should look like &lt;BR /&gt;AUS-001001 1 520&lt;BR /&gt;AUS-001001 2 0&lt;BR /&gt;AUS-001001 3 0&lt;BR /&gt;AUS-001001 4 0&lt;BR /&gt;AUS-001001 5 0&lt;BR /&gt;AUS-001001 6 100&lt;BR /&gt;US-001001 1 0  100&lt;BR /&gt;US-001001 2  100&lt;BR /&gt;US-001001 3 100&lt;BR /&gt;US-001001 4  100&lt;BR /&gt;US-001001 5 100&lt;BR /&gt;US-001001 6  100&lt;BR /&gt;PAK-001001 1 70&lt;BR /&gt;PAK-001001 2 80&lt;BR /&gt;PAK-001001 3 0&lt;BR /&gt;PAK-001001 4 0&lt;BR /&gt;PAK-001001 5 0&lt;BR /&gt;PAK-001001 6 80&lt;BR /&gt;&lt;BR /&gt;basically if there is a row blank the value from the upper row must be copied to that place</description>
    <pubDate>Thu, 02 Apr 2020 20:57:10 GMT</pubDate>
    <dc:creator>sahoositaram555</dc:creator>
    <dc:date>2020-04-02T20:57:10Z</dc:date>
    <item>
      <title>LAST VALUE CARRY FORWARD</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637068#M189358</link>
      <description>&lt;P&gt;Hi, I have a dataset where i have do last value carry forward by downword rows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any leads would be helpful.&lt;/P&gt;
&lt;P&gt;data CM;&lt;/P&gt;
&lt;P&gt;input USUBJID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mmmol_injected;cards;&lt;/P&gt;
&lt;P&gt;AUS-001001&amp;nbsp; 520&lt;BR /&gt;AUS-001001&amp;nbsp; 0&lt;BR /&gt;AUS-001001&amp;nbsp; .&lt;BR /&gt;AUS-001001&amp;nbsp; .&lt;/P&gt;
&lt;P&gt;AUS-001001&amp;nbsp; .&lt;/P&gt;
&lt;P&gt;AUS-001001&amp;nbsp; 100&lt;BR /&gt;US-001001&amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;US-001001&amp;nbsp; &amp;nbsp; .&lt;/P&gt;
&lt;P&gt;US-001001&amp;nbsp; &amp;nbsp; 100&lt;/P&gt;
&lt;P&gt;US-001001&amp;nbsp; &amp;nbsp; .&lt;/P&gt;
&lt;P&gt;US-001001&amp;nbsp; &amp;nbsp; 100&lt;/P&gt;
&lt;P&gt;US-001001&amp;nbsp; &amp;nbsp; .&lt;/P&gt;
&lt;P&gt;PAK-001001&amp;nbsp; 70&lt;/P&gt;
&lt;P&gt;PAK-001001&amp;nbsp; 80&lt;/P&gt;
&lt;P&gt;PAK-001001&amp;nbsp; 0&lt;/P&gt;
&lt;P&gt;PAK-001001&amp;nbsp; 0&lt;/P&gt;
&lt;P&gt;PAK-001001&amp;nbsp; .&lt;/P&gt;
&lt;P&gt;PAK-001001&amp;nbsp; 80&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 20:48:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637068#M189358</guid>
      <dc:creator>sahoositaram555</dc:creator>
      <dc:date>2020-04-02T20:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: LAST VALUE CARRY FORWARD</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637069#M189359</link>
      <description>&lt;P&gt;You want the last non-missing value carried forward by &lt;SPAN&gt;USUBJID, correct?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 20:49:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637069#M189359</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-04-02T20:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: LAST VALUE CARRY FORWARD</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637071#M189361</link>
      <description>Sorry dear &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;,&lt;BR /&gt;it has a visitn column as well. So i have to do it by subjid &amp;amp; visitn .&lt;BR /&gt;data CM;&lt;BR /&gt;&lt;BR /&gt;input USUBJID  visitn   mmmol_injected;cards;&lt;BR /&gt;&lt;BR /&gt;AUS-001001 1  520&lt;BR /&gt;AUS-001001 2  0&lt;BR /&gt;AUS-001001  3 .&lt;BR /&gt;AUS-001001  4 .&lt;BR /&gt;AUS-001001  5 .&lt;BR /&gt;AUS-001001 6  100&lt;BR /&gt;US-001001   1  0&lt;BR /&gt;US-001001   2  .&lt;BR /&gt;US-001001   3 100&lt;BR /&gt;US-001001   4  .&lt;BR /&gt;US-001001   5 100&lt;BR /&gt;US-001001   6 .&lt;BR /&gt;PAK-001001 1  70&lt;BR /&gt;PAK-001001 2  80&lt;BR /&gt;PAK-001001  3 0&lt;BR /&gt;PAK-001001 4  0&lt;BR /&gt;PAK-001001 5  .&lt;BR /&gt;PAK-001001 6  80&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Apr 2020 20:53:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637071#M189361</guid>
      <dc:creator>sahoositaram555</dc:creator>
      <dc:date>2020-04-02T20:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: LAST VALUE CARRY FORWARD</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637072#M189362</link>
      <description>&lt;P&gt;I'm not sure I understand the requirement. What does your desired result look like?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 20:54:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637072#M189362</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-04-02T20:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: LAST VALUE CARRY FORWARD</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637075#M189365</link>
      <description>Dear &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;,&lt;BR /&gt;the resulted data set should look like &lt;BR /&gt;AUS-001001 1 520&lt;BR /&gt;AUS-001001 2 0&lt;BR /&gt;AUS-001001 3 0&lt;BR /&gt;AUS-001001 4 0&lt;BR /&gt;AUS-001001 5 0&lt;BR /&gt;AUS-001001 6 100&lt;BR /&gt;US-001001 1 0  100&lt;BR /&gt;US-001001 2  100&lt;BR /&gt;US-001001 3 100&lt;BR /&gt;US-001001 4  100&lt;BR /&gt;US-001001 5 100&lt;BR /&gt;US-001001 6  100&lt;BR /&gt;PAK-001001 1 70&lt;BR /&gt;PAK-001001 2 80&lt;BR /&gt;PAK-001001 3 0&lt;BR /&gt;PAK-001001 4 0&lt;BR /&gt;PAK-001001 5 0&lt;BR /&gt;PAK-001001 6 80&lt;BR /&gt;&lt;BR /&gt;basically if there is a row blank the value from the upper row must be copied to that place</description>
      <pubDate>Thu, 02 Apr 2020 20:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637075#M189365</guid>
      <dc:creator>sahoositaram555</dc:creator>
      <dc:date>2020-04-02T20:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: LAST VALUE CARRY FORWARD</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637076#M189366</link>
      <description>&lt;P&gt;Ok. Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data CM;
input USUBJID $10. mmmol_injected;
cards;
AUS-001001  520
AUS-001001  0
AUS-001001  .
AUS-001001  .
AUS-001001  .
AUS-001001  100
US-001001    0
US-001001    .
US-001001    100
US-001001    .
US-001001    100
US-001001    .
PAK-001001  70
PAK-001001  80
PAK-001001  0
PAK-001001  0
PAK-001001  .
PAK-001001  80
;
run;

data want (drop=_:);
   set CM;
   by USUBJID notsorted;
   retain _mm;
   if first.USUBJID then _mm=.;
   if mmmol_injected ne . then _mm=mmmol_injected;
   else if mmmol_injected=. then mmmol_injected=_mm;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Apr 2020 21:01:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637076#M189366</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-04-02T21:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: LAST VALUE CARRY FORWARD</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637080#M189370</link>
      <description>Thank you very much &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;. it worked.</description>
      <pubDate>Thu, 02 Apr 2020 21:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAST-VALUE-CARRY-FORWARD/m-p/637080#M189370</guid>
      <dc:creator>sahoositaram555</dc:creator>
      <dc:date>2020-04-02T21:06:15Z</dc:date>
    </item>
  </channel>
</rss>

