<?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 minmum of two dates that is not misssing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/find-the-minmum-of-two-dates-that-is-not-misssing/m-p/310057#M66819</link>
    <description>&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2016 13:35:04 GMT</pubDate>
    <dc:creator>lillymaginta</dc:creator>
    <dc:date>2016-11-08T13:35:04Z</dc:date>
    <item>
      <title>find the minmum of two dates that is not misssing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-the-minmum-of-two-dates-that-is-not-misssing/m-p/310013#M66814</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;id       date_1           date_2              date_3
1    .                     02/02/2012     01/01/2001    
2     01/11/2009     2/10/2011     01/01/2004    
3     01/08/2013      .                      2/10/2012
4    11/10/2015     01/01/1998     26/12/2014&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am trying to the find the minimum of three dates but I have some missing information so I want to retain the minmum among the one that is avaiable:&lt;/P&gt;&lt;P&gt;output&lt;/P&gt;&lt;P&gt;1 01/01/2001&lt;/P&gt;&lt;P&gt;2 01/01/2004&lt;/P&gt;&lt;P&gt;3 02/10/2012&lt;/P&gt;&lt;P&gt;4 01/01/1998&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 10:48:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-the-minmum-of-two-dates-that-is-not-misssing/m-p/310013#M66814</guid>
      <dc:creator>lillymaginta</dc:creator>
      <dc:date>2016-11-08T10:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: find the minmum of two dates that is not misssing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-the-minmum-of-two-dates-that-is-not-misssing/m-p/310016#M66816</link>
      <description>&lt;P&gt;The MIN function already handles this issue? So the following will do&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
informat date_1 date_2 date_3 ddmmyy10.;
input id date_1 date_2 date_3;
format date_1 date_2 date_3 ddmmyy10.;
datalines;
1 .          02/02/2012 01/01/2001
2 01/11/2009 2/10/2011  01/01/2004
3 01/08/2013 .          02/10/2012
4 11/10/2015 01/01/1998 26/12/2014
;

data want;
   set have;

   newvar = min(date_1,date_2,date_3);
   format newvar  ddmmyy10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 10:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-the-minmum-of-two-dates-that-is-not-misssing/m-p/310016#M66816</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2016-11-08T10:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: find the minmum of two dates that is not misssing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-the-minmum-of-two-dates-that-is-not-misssing/m-p/310022#M66817</link>
      <description>&lt;P&gt;Just to add, functions like min() can also accept ranges of variables which can make typing much easier when you have lots of variables:&lt;/P&gt;
&lt;PRE&gt;newvar=min(of date_:);&lt;/PRE&gt;
&lt;P&gt;Assumes of course all variables have same prefix (or you setup and array of them before).&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 11:25:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-the-minmum-of-two-dates-that-is-not-misssing/m-p/310022#M66817</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-08T11:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: find the minmum of two dates that is not misssing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/find-the-minmum-of-two-dates-that-is-not-misssing/m-p/310057#M66819</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 13:35:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/find-the-minmum-of-two-dates-that-is-not-misssing/m-p/310057#M66819</guid>
      <dc:creator>lillymaginta</dc:creator>
      <dc:date>2016-11-08T13:35:04Z</dc:date>
    </item>
  </channel>
</rss>

