<?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: Find the non-missing value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Find-the-non-missing-value/m-p/241374#M44717</link>
    <description>I would recommend the coalesce() function which takes the first non missing value in a series of variables specified. &lt;BR /&gt;&lt;BR /&gt;Coalesce(a, b) as C</description>
    <pubDate>Thu, 31 Dec 2015 13:52:18 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-12-31T13:52:18Z</dc:date>
    <item>
      <title>Find the non-missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-the-non-missing-value/m-p/241357#M44714</link>
      <description>&lt;P&gt;I've a dataset like below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A &amp;nbsp; &amp;nbsp;B&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp;.&lt;/P&gt;
&lt;P&gt;. &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;
&lt;P&gt;3 &amp;nbsp; &amp;nbsp;.&lt;/P&gt;
&lt;P&gt;. &amp;nbsp; &amp;nbsp; 4&lt;/P&gt;
&lt;P&gt;5 &amp;nbsp; &amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need the dataset like below. Basically I need the non-missing values for each observation. May I request someone to guide me to accomplish this task via Proc SQL?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A &amp;nbsp; &amp;nbsp;B &amp;nbsp; C&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp;. &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;. &amp;nbsp; &amp;nbsp; 2 &amp;nbsp; &amp;nbsp;2&lt;/P&gt;
&lt;P&gt;3 &amp;nbsp; &amp;nbsp;. &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;. &amp;nbsp; &amp;nbsp; 4 &amp;nbsp; &amp;nbsp;4&lt;/P&gt;
&lt;P&gt;5 &amp;nbsp; &amp;nbsp;. &amp;nbsp; &amp;nbsp; 5&lt;/P&gt;</description>
      <pubDate>Thu, 31 Dec 2015 10:07:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-the-non-missing-value/m-p/241357#M44714</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-12-31T10:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Find the non-missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-the-non-missing-value/m-p/241360#M44715</link>
      <description>&lt;P&gt;Like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The MAX function ignores null values and SAS missing values. So the missing is completely ignored. Thus: max does not return 5 because 5 &amp;gt; . , the missing is just not considered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ab;
input a b;
datalines;
1    .
.    2
3    .
.    4
5    .
;
run;

PROC SQL noprint;
 create table abc as
 select * , max(a,b) as c  
 from ab;
QUIT;
/* end of program */
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Thu, 31 Dec 2015 10:22:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-the-non-missing-value/m-p/241360#M44715</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2015-12-31T10:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Find the non-missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-the-non-missing-value/m-p/241374#M44717</link>
      <description>I would recommend the coalesce() function which takes the first non missing value in a series of variables specified. &lt;BR /&gt;&lt;BR /&gt;Coalesce(a, b) as C</description>
      <pubDate>Thu, 31 Dec 2015 13:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-the-non-missing-value/m-p/241374#M44717</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-31T13:52:18Z</dc:date>
    </item>
  </channel>
</rss>

