<?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 to replace missing value using values in the previous line? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-replace-missing-value-using-values-in-the-previous-line/m-p/60144#M17044</link>
    <description>or use:&lt;BR /&gt;
&lt;BR /&gt;
a=coalesce(a,lag(a));</description>
    <pubDate>Thu, 30 Jul 2009 13:04:34 GMT</pubDate>
    <dc:creator>HenrikOlsen</dc:creator>
    <dc:date>2009-07-30T13:04:34Z</dc:date>
    <item>
      <title>How to replace missing value using values in the previous line?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-replace-missing-value-using-values-in-the-previous-line/m-p/60142#M17042</link>
      <description>Hello everyone, &lt;BR /&gt;
&lt;BR /&gt;
I want to ask how to use values in the previous line to replace the missing value?&lt;BR /&gt;
Any help?  I try:&lt;BR /&gt;
&lt;BR /&gt;
if missing(a) then a=lag(a);&lt;BR /&gt;
&lt;BR /&gt;
but this does not work.&lt;BR /&gt;
&lt;BR /&gt;
Thank you! and Wait online!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-----------Before--------------&lt;BR /&gt;
a b c&lt;BR /&gt;
&lt;BR /&gt;
1 2 3&lt;BR /&gt;
.  .  .&lt;BR /&gt;
.  .  .&lt;BR /&gt;
2 3 4&lt;BR /&gt;
.  .  .&lt;BR /&gt;
.  .  .&lt;BR /&gt;
.  .  .&lt;BR /&gt;
.  .  .&lt;BR /&gt;
3 5 6&lt;BR /&gt;
.  .  .&lt;BR /&gt;
----------After------------&lt;BR /&gt;
&lt;BR /&gt;
a b c&lt;BR /&gt;
&lt;BR /&gt;
1 2 3&lt;BR /&gt;
1 2 3&lt;BR /&gt;
1 2 3&lt;BR /&gt;
2 3 4&lt;BR /&gt;
2 3 4&lt;BR /&gt;
2 3 4&lt;BR /&gt;
2 3 4&lt;BR /&gt;
2 3 4&lt;BR /&gt;
3 5 6&lt;BR /&gt;
3 5 6&lt;BR /&gt;
&lt;BR /&gt;
--------------------------</description>
      <pubDate>Wed, 29 Jul 2009 20:54:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-replace-missing-value-using-values-in-the-previous-line/m-p/60142#M17042</guid>
      <dc:creator>Ken_oy</dc:creator>
      <dc:date>2009-07-29T20:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace missing value using values in the previous line?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-replace-missing-value-using-values-in-the-previous-line/m-p/60143#M17043</link>
      <description>Perform the lag function assignment for each observation, creating:&lt;BR /&gt;
&lt;BR /&gt;
l_a = lag(a);&lt;BR /&gt;
&lt;BR /&gt;
then do you conditional assignment / override when the missing condition occurs.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 29 Jul 2009 21:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-replace-missing-value-using-values-in-the-previous-line/m-p/60143#M17043</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-07-29T21:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace missing value using values in the previous line?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-replace-missing-value-using-values-in-the-previous-line/m-p/60144#M17044</link>
      <description>or use:&lt;BR /&gt;
&lt;BR /&gt;
a=coalesce(a,lag(a));</description>
      <pubDate>Thu, 30 Jul 2009 13:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-replace-missing-value-using-values-in-the-previous-line/m-p/60144#M17044</guid>
      <dc:creator>HenrikOlsen</dc:creator>
      <dc:date>2009-07-30T13:04:34Z</dc:date>
    </item>
  </channel>
</rss>

