<?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: fill missing values with known non-missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/424836#M281072</link>
    <description>&lt;P&gt;is it that simple to fill with max of values as your sample data suggests?&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jan 2018 06:38:22 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-01-04T06:38:22Z</dc:date>
    <item>
      <title>fill missing values with known non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/424826#M281069</link>
      <description>&lt;P&gt;I run into a problem of filling the missing values with non-missing values. What's tricky here is the nonmissng values are random, so I cannot determine whether to use the first non-missing value or the last non-missing value.&lt;/P&gt;&lt;P&gt;Example: Variable is my variable of interest&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ID&amp;nbsp;company&amp;nbsp;variable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 A&amp;nbsp;123&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1&amp;nbsp;A&amp;nbsp;.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1&amp;nbsp;A 123&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1&amp;nbsp;A 123&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 A .&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2 B 321&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;B .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;B .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;B .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;What i want here is to fill the variable with 123 if the id=1 and variable with 321 if id=2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestion will be appreciated ! Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 05:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/424826#M281069</guid>
      <dc:creator>phdstudent123</dc:creator>
      <dc:date>2018-01-04T05:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: fill missing values with known non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/424829#M281070</link>
      <description>&lt;P&gt;Forgot to mention that variable is not fixed and can be solely determined by known variables only with the same ID number.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 05:51:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/424829#M281070</guid>
      <dc:creator>phdstudent123</dc:creator>
      <dc:date>2018-01-04T05:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: fill missing values with known non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/424833#M281071</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table want as&lt;BR /&gt;select ID, company, max(variable) as variable from have&lt;BR /&gt;group by id;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 06:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/424833#M281071</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2018-01-04T06:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: fill missing values with known non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/424836#M281072</link>
      <description>&lt;P&gt;is it that simple to fill with max of values as your sample data suggests?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 06:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/424836#M281072</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-04T06:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: fill missing values with known non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/424837#M281073</link>
      <description>&lt;P&gt;not sure i understand the data but id remove duplicates then merge back on&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=A;&lt;/P&gt;&lt;P&gt;by id company descending variable;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=A out=B nodupkey;&lt;/P&gt;&lt;P&gt;by id company;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data C;&lt;/P&gt;&lt;P&gt;merge A (drop=variable) B;&lt;/P&gt;&lt;P&gt;by id company;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but the other solution suggested is more pithy!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 06:45:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/424837#M281073</guid>
      <dc:creator>pau13rown</dc:creator>
      <dc:date>2018-01-04T06:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: fill missing values with known non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/425108#M281074</link>
      <description>&lt;P&gt;Thank you! That works. Btw, does that also apply to string variables too?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 00:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/425108#M281074</guid>
      <dc:creator>phdstudent123</dc:creator>
      <dc:date>2018-01-05T00:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: fill missing values with known non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/425109#M281075</link>
      <description>Thank you, that works as well!</description>
      <pubDate>Fri, 05 Jan 2018 00:41:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/425109#M281075</guid>
      <dc:creator>phdstudent123</dc:creator>
      <dc:date>2018-01-05T00:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: fill missing values with known non-missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/425124#M281076</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/184834"&gt;@phdstudent123&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Then please accept one of the answers as solution so this question gets closed.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 03:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/fill-missing-values-with-known-non-missing-values/m-p/425124#M281076</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-01-05T03:12:34Z</dc:date>
    </item>
  </channel>
</rss>

