<?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: Start Date and Time - stop date time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Start-Date-and-Time-stop-date-time/m-p/351098#M81697</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input SRTDT$         PSTTM$           STPDT$             PEDTM$;
cards;
20150211     1942               20150212         0030  
20130826     1220               20130826         1535
;


data want;
set have;
shr=input(SUBSTR(strip(PSTTM), 1,2),best.);
smi=input(SUBSTR(strip(PSTTM), 3,2),best.);
ssec=coalesce(input(SUBSTR(strip(PSTTM),5,2),best.),0);
sday=input(strip(SRTDT),yymmdd10.);

ehr=input(SUBSTR(strip(PEDTM), 1,2),best.);
emi=input(SUBSTR(strip(PEDTM), 3,2),best.);
esec=coalesce(input(SUBSTR(strip(PEDTM),5,2),best.),0);
eday=input(strip(STPDT),yymmdd10.);

startdate=dhms(sday,shr,smi,ssec);
stopdate=dhms(eday,ehr,emi,esec);

diff=intck('minute',startdate,stopdate);
format startdate stopdate datetime20.;

run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 19 Apr 2017 01:14:24 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2017-04-19T01:14:24Z</dc:date>
    <item>
      <title>Start Date and Time - stop date time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Start-Date-and-Time-stop-date-time/m-p/351085#M81695</link>
      <description>&lt;P&gt;i have dataset with charater SAS date and time as below:&lt;/P&gt;&lt;P&gt;SRTDT-START DATE&lt;/P&gt;&lt;P&gt;PSTTM- START TIME&lt;/P&gt;&lt;P&gt;STPDT-STOP DATE&lt;/P&gt;&lt;P&gt;PEDTM-END TIME&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SRTDT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PSTTM &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; STPDT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PEDTM&lt;/P&gt;&lt;P&gt;20150211 &amp;nbsp; &amp;nbsp; 1942 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20150212 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0030 &amp;nbsp;&lt;/P&gt;&lt;P&gt;20130826 &amp;nbsp; &amp;nbsp; 1220 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20130826 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1535&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate the whole procedure time in minute. any suggestions !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 00:01:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Start-Date-and-Time-stop-date-time/m-p/351085#M81695</guid>
      <dc:creator>dhrums28</dc:creator>
      <dc:date>2017-04-19T00:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Start Date and Time - stop date time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Start-Date-and-Time-stop-date-time/m-p/351095#M81696</link>
      <description>&lt;P&gt;Depends! Does 1942 represent 7:42pm?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 01:02:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Start-Date-and-Time-stop-date-time/m-p/351095#M81696</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-04-19T01:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Start Date and Time - stop date time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Start-Date-and-Time-stop-date-time/m-p/351098#M81697</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input SRTDT$         PSTTM$           STPDT$             PEDTM$;
cards;
20150211     1942               20150212         0030  
20130826     1220               20130826         1535
;


data want;
set have;
shr=input(SUBSTR(strip(PSTTM), 1,2),best.);
smi=input(SUBSTR(strip(PSTTM), 3,2),best.);
ssec=coalesce(input(SUBSTR(strip(PSTTM),5,2),best.),0);
sday=input(strip(SRTDT),yymmdd10.);

ehr=input(SUBSTR(strip(PEDTM), 1,2),best.);
emi=input(SUBSTR(strip(PEDTM), 3,2),best.);
esec=coalesce(input(SUBSTR(strip(PEDTM),5,2),best.),0);
eday=input(strip(STPDT),yymmdd10.);

startdate=dhms(sday,shr,smi,ssec);
stopdate=dhms(eday,ehr,emi,esec);

diff=intck('minute',startdate,stopdate);
format startdate stopdate datetime20.;

run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Apr 2017 01:14:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Start-Date-and-Time-stop-date-time/m-p/351098#M81697</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-04-19T01:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Start Date and Time - stop date time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Start-Date-and-Time-stop-date-time/m-p/351108#M81699</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input SRTDT $ PSTTM $ STPDT $ PEDTM $;
datalines;
20150211     1942               20150212         0030  
20130826     1220               20130826         1535
;

data want;
set have;
strt = dhms(
    input(srtdt,yymmdd8.), 
    input(substr(psttm,1,2), 2.), 
    input(substr(psttm,3,2), 2.), 0);
endt = dhms(
    input(stpdt,yymmdd8.), 
    input(substr(pedtm,1,2), 2.), 
    input(substr(pedtm,3,2), 2.), 0);
minutes = intck("minute", strt, endt);
format strt endt datetime15.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Apr 2017 02:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Start-Date-and-Time-stop-date-time/m-p/351108#M81699</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-04-19T02:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Start Date and Time - stop date time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Start-Date-and-Time-stop-date-time/m-p/351175#M81718</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS does have the HHMMSS. informat which can read either hh:mm:ss or hhmmss time values, together with the YYMMDD. informat you can convert the char values to SAS date and time values, the DHMS will make a datetime value out of it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input SRTDT $ PSTTM $ STPDT $ PEDTM $;
  psttm2 = input(psttm, hhmmss4.);
  srtdt2 = input(srtdt, yymmdd8.);

  startDate = dhms(srtdt2,0,0,psttm2);
  format
    psttm2 time8.
    srtdt2 date9.
    startDate datetime19.
  ;
  datalines;
20150211     1942               20150212         0030  
20130826     1220               20130826         1535
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 07:45:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Start-Date-and-Time-stop-date-time/m-p/351175#M81718</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2017-04-19T07:45:42Z</dc:date>
    </item>
  </channel>
</rss>

