<?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 do I combine multiple columns with missing data and prioritizing certain columns using Proc in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-combine-multiple-columns-with-missing-data-and/m-p/367474#M87485</link>
    <description>&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select case&lt;/P&gt;&lt;P&gt;when date1 ne . then date1&lt;/P&gt;&lt;P&gt;when date1=. and date2 ne . then date 2&lt;/P&gt;&lt;P&gt;when date1=. and date2=. then date3&lt;/P&gt;&lt;P&gt;end as date from table;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jun 2017 18:41:15 GMT</pubDate>
    <dc:creator>vsing154</dc:creator>
    <dc:date>2017-06-15T18:41:15Z</dc:date>
    <item>
      <title>How do I combine multiple columns with missing data and prioritizing certain columns using Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-combine-multiple-columns-with-missing-data-and/m-p/367466#M87479</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm have a dataset with 3 columns of dates. What I would like to do is create one single column which prioritizes putting&amp;nbsp;Date 1 in it, but if Date 1 is missing it places Date 2 into the new column and finally if both Date 1 and Date 2 are missing it places Date 3 into the new column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date 1&lt;/TD&gt;&lt;TD&gt;Date 2&lt;/TD&gt;&lt;TD&gt;Date 3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6/15/2017&lt;/TD&gt;&lt;TD&gt;6/14/2017&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;6/12/2017&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;6/15/2017&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6/14/2017&lt;/TD&gt;&lt;TD&gt;6/15/2017&lt;/TD&gt;&lt;TD&gt;6/20/2017&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output should look like this&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6/15/2017&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6/12/2017&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6/15/2017&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6/14/2017&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 17:57:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-combine-multiple-columns-with-missing-data-and/m-p/367466#M87479</guid>
      <dc:creator>chavezt87</dc:creator>
      <dc:date>2017-06-15T17:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I combine multiple columns with missing data and prioritizing certain columns using Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-combine-multiple-columns-with-missing-data-and/m-p/367467#M87480</link>
      <description>&lt;P&gt;date=coalesce (of date1--date3);&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 18:08:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-combine-multiple-columns-with-missing-data-and/m-p/367467#M87480</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2017-06-15T18:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I combine multiple columns with missing data and prioritizing certain columns using Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-combine-multiple-columns-with-missing-data-and/m-p/367468#M87481</link>
      <description>&lt;P&gt;You can use IF THEN condition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF NOT MISSING(DATE1) THEN DATE=DATE1;&lt;BR /&gt;ELSE IF MISSING(DATE1) AND NOT MISSING(DATE2) THEN DATE=DATE2;&lt;BR /&gt;ELSE DATE=DATE3;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 18:14:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-combine-multiple-columns-with-missing-data-and/m-p/367468#M87481</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2017-06-15T18:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I combine multiple columns with missing data and prioritizing certain columns using Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-combine-multiple-columns-with-missing-data-and/m-p/367474#M87485</link>
      <description>&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select case&lt;/P&gt;&lt;P&gt;when date1 ne . then date1&lt;/P&gt;&lt;P&gt;when date1=. and date2 ne . then date 2&lt;/P&gt;&lt;P&gt;when date1=. and date2=. then date3&lt;/P&gt;&lt;P&gt;end as date from table;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 18:41:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-combine-multiple-columns-with-missing-data-and/m-p/367474#M87485</guid>
      <dc:creator>vsing154</dc:creator>
      <dc:date>2017-06-15T18:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I combine multiple columns with missing data and prioritizing certain columns using Proc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-combine-multiple-columns-with-missing-data-and/m-p/367511#M87499</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 21:33:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-combine-multiple-columns-with-missing-data-and/m-p/367511#M87499</guid>
      <dc:creator>chavezt87</dc:creator>
      <dc:date>2017-06-15T21:33:39Z</dc:date>
    </item>
  </channel>
</rss>

