<?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 'right fill' empty cells in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-right-fill-empty-cells-in-SAS/m-p/498900#M132661</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to fill in empty cells using the value from the first non-missing cell to the left of that empty cell in each row.&amp;nbsp;The table runs from January 1, 2014 through August 1, 2018. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-09-25 at 6.49.06 PM.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23523iF7F2EF77CAAC036D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-09-25 at 6.49.06 PM.png" alt="Screen Shot 2018-09-25 at 6.49.06 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data desiredtable;&lt;/P&gt;&lt;P&gt;set rawtable;&lt;/P&gt;&lt;P&gt;if variable=. then lag(variable);&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But seems like this only works if the table was set up in long format vs. wide format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated. Thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Aidan&lt;/P&gt;</description>
    <pubDate>Wed, 26 Sep 2018 00:52:12 GMT</pubDate>
    <dc:creator>aidant01</dc:creator>
    <dc:date>2018-09-26T00:52:12Z</dc:date>
    <item>
      <title>How to 'right fill' empty cells in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-right-fill-empty-cells-in-SAS/m-p/498900#M132661</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to fill in empty cells using the value from the first non-missing cell to the left of that empty cell in each row.&amp;nbsp;The table runs from January 1, 2014 through August 1, 2018. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-09-25 at 6.49.06 PM.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23523iF7F2EF77CAAC036D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-09-25 at 6.49.06 PM.png" alt="Screen Shot 2018-09-25 at 6.49.06 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data desiredtable;&lt;/P&gt;&lt;P&gt;set rawtable;&lt;/P&gt;&lt;P&gt;if variable=. then lag(variable);&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But seems like this only works if the table was set up in long format vs. wide format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated. Thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Aidan&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 00:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-right-fill-empty-cells-in-SAS/m-p/498900#M132661</guid>
      <dc:creator>aidant01</dc:creator>
      <dc:date>2018-09-26T00:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to 'right fill' empty cells in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-right-fill-empty-cells-in-SAS/m-p/498922#M132673</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
  input A B C D E F G H  ;
  cards;
. 1 . 2 3 . . .
run;
data WANT;
  set HAVE;
  array ARR [8] A -- H ;
  do I=2 to 8;
    if ARR[I]=. then ARR[I]=ARR[I-1];
  end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 02:29:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-right-fill-empty-cells-in-SAS/m-p/498922#M132673</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-09-26T02:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to 'right fill' empty cells in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-right-fill-empty-cells-in-SAS/m-p/499328#M132850</link>
      <description>&lt;P&gt;Thanks Chris it worked!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 00:15:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-right-fill-empty-cells-in-SAS/m-p/499328#M132850</guid>
      <dc:creator>aidant01</dc:creator>
      <dc:date>2018-09-27T00:15:22Z</dc:date>
    </item>
  </channel>
</rss>

