<?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 populate the intermittent blank spaces with the last available non-zero value ?? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-populate-the-intermittent-blank-spaces-with-the-last/m-p/149292#M262344</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My name is Baiju Joseph and I am a student. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I encountered a problem while doing a project, which I would like to share with you all &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for a variable Base in a dataset following was the pattern:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="64"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="64"&gt;Base&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now for all the null values I would like to put the preceding non zero value in it till I reach the next non zero value in the variable and so on and so forth, until there are no null values in the variable. for example Observations 4-9 are null, and hence I would like to fill in the value of the preceding non zero observation (ie Obs 3 with value 6) in all the observations till I reach Obs 10, which is a non zero observation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what can be done to achieve this ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly reply back with your answers &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all !!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jun 2014 05:39:12 GMT</pubDate>
    <dc:creator>Starsagitarian</dc:creator>
    <dc:date>2014-06-20T05:39:12Z</dc:date>
    <item>
      <title>How to populate the intermittent blank spaces with the last available non-zero value ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-populate-the-intermittent-blank-spaces-with-the-last/m-p/149292#M262344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My name is Baiju Joseph and I am a student. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I encountered a problem while doing a project, which I would like to share with you all &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for a variable Base in a dataset following was the pattern:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="64"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="64"&gt;Base&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now for all the null values I would like to put the preceding non zero value in it till I reach the next non zero value in the variable and so on and so forth, until there are no null values in the variable. for example Observations 4-9 are null, and hence I would like to fill in the value of the preceding non zero observation (ie Obs 3 with value 6) in all the observations till I reach Obs 10, which is a non zero observation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what can be done to achieve this ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly reply back with your answers &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all !!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 05:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-populate-the-intermittent-blank-spaces-with-the-last/m-p/149292#M262344</guid>
      <dc:creator>Starsagitarian</dc:creator>
      <dc:date>2014-06-20T05:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to populate the intermittent blank spaces with the last available non-zero value ??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-populate-the-intermittent-blank-spaces-with-the-last/m-p/149293#M262345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several ways to do this, first one that springs to mind for me is a retain:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain lstval;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if base ne . then lstval=base;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else base=lstval;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are other suggestions if you search the forums.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 08:26:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-populate-the-intermittent-blank-spaces-with-the-last/m-p/149293#M262345</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-06-20T08:26:40Z</dc:date>
    </item>
  </channel>
</rss>

