<?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: Handling missing time varaible in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Handling-missing-time-varaible/m-p/478213#M14950</link>
    <description>&lt;P&gt;Here is one solution&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UNTESTED CODE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    if not missing(time) then datetime=dhms(date,hour(time),minute(time),0);
    else datetime=dhms(date,0,0,0);
run;
proc sort data=have;
    by datetime;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Naturally, there are other solutions regarding what to do with the missing time variable, I'm sure you can think of other ways to handle this.&lt;/P&gt;</description>
    <pubDate>Sun, 15 Jul 2018 17:12:11 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-07-15T17:12:11Z</dc:date>
    <item>
      <title>Handling missing time varaible</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Handling-missing-time-varaible/m-p/478210#M14949</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have two variables in my data set date and time(HH:MM) in seperate columns, i need to combine those columns and sort the data by&amp;nbsp; date and time per subject.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While doing so i came across the situation like, the time is missing for one of the subjects ,and when i sort the data ,the record with missing time sorted to the top which leads to incorrect sorted data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help me with this and handle the situation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 16:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Handling-missing-time-varaible/m-p/478210#M14949</guid>
      <dc:creator>pavan1</dc:creator>
      <dc:date>2018-07-15T16:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Handling missing time varaible</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Handling-missing-time-varaible/m-p/478213#M14950</link>
      <description>&lt;P&gt;Here is one solution&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UNTESTED CODE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    if not missing(time) then datetime=dhms(date,hour(time),minute(time),0);
    else datetime=dhms(date,0,0,0);
run;
proc sort data=have;
    by datetime;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Naturally, there are other solutions regarding what to do with the missing time variable, I'm sure you can think of other ways to handle this.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 17:12:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Handling-missing-time-varaible/m-p/478213#M14950</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-15T17:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Handling missing time varaible</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Handling-missing-time-varaible/m-p/478220#M14951</link>
      <description>&lt;P&gt;thank you so much paige&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 18:06:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Handling-missing-time-varaible/m-p/478220#M14951</guid>
      <dc:creator>pavan1</dc:creator>
      <dc:date>2018-07-15T18:06:32Z</dc:date>
    </item>
  </channel>
</rss>

