<?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: compare visit time among all phases in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/compare-visit-time-among-all-phases/m-p/862416#M340665</link>
    <description>&lt;P&gt;Dates or times in character format are USELESS. Convert them in the database before doing anything else.&lt;/P&gt;
&lt;P&gt;What should be the result of your data?&lt;/P&gt;</description>
    <pubDate>Mon, 06 Mar 2023 06:08:42 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-03-06T06:08:42Z</dc:date>
    <item>
      <title>compare visit time among all phases</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-visit-time-among-all-phases/m-p/862397#M340652</link>
      <description>&lt;P&gt;Hi Everyone!&lt;/P&gt;
&lt;P&gt;For my study, I want to retrieve records from all phases when one hour prior to&amp;nbsp; first visit time i.e. visit_F ({HH:MM}-1)&amp;nbsp;is&amp;nbsp;greater&amp;nbsp;than&amp;nbsp;last visit time (HH:MM)&lt;/P&gt;
&lt;P&gt;In database, all dates are stored in character format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data visit;
input phase visit_F $20. visit_E $20.;
cards;
1 2012-04-24T19:22:03 2012-04-24T20:23:03
2 2012-04-22T07:22:03 2012-04-22T07:22:01
3 2012-04-24T19:22:03 2012-04-24T16:23:03
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Mar 2023 01:57:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-visit-time-among-all-phases/m-p/862397#M340652</guid>
      <dc:creator>abraham1</dc:creator>
      <dc:date>2023-03-06T01:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: compare visit time among all phases</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-visit-time-among-all-phases/m-p/862416#M340665</link>
      <description>&lt;P&gt;Dates or times in character format are USELESS. Convert them in the database before doing anything else.&lt;/P&gt;
&lt;P&gt;What should be the result of your data?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 06:08:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-visit-time-among-all-phases/m-p/862416#M340665</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-06T06:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: compare visit time among all phases</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-visit-time-among-all-phases/m-p/862428#M340670</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;remarked, you should change the data to numeric datetimes, if possible. If not, you will have to do the conversion on the fly, e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;                                                                                                                              
  set visit;                                                                                                                            
  dt_first=input(visit_f,e8601dt.);                                                                                                     
  dt_last=input(visit_e,e8601dt.);                                                                                                      
  format dt_: datetime22.;                                                                                                              
  if dt_first-3600&amp;gt;dt_last;                                                                                                             
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The 3600 is (of course) the number of seconds in an hour, SAS datetime values are recorded as the number of seconds since January first, 1960.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 07:40:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-visit-time-among-all-phases/m-p/862428#M340670</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2023-03-06T07:40:40Z</dc:date>
    </item>
  </channel>
</rss>

