<?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: Continuation -Re: Calculate length of time job runs-over midnight in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Continuation-Re-Calculate-length-of-time-job-runs-over-midnight/m-p/338856#M77252</link>
    <description>thank you!</description>
    <pubDate>Tue, 07 Mar 2017 15:53:20 GMT</pubDate>
    <dc:creator>labin</dc:creator>
    <dc:date>2017-03-07T15:53:20Z</dc:date>
    <item>
      <title>Continuation -Re: Calculate length of time job runs-over midnight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Continuation-Re-Calculate-length-of-time-job-runs-over-midnight/m-p/338593#M77135</link>
      <description>&lt;DIV class="lia-quilt-column lia-quilt-column-04 lia-quilt-column-left lia-quilt-column-main-left"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-quilt-column lia-quilt-column-20 lia-quilt-column-right lia-quilt-column-main-right"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-right"&gt;&lt;DIV class="lia-message-body lia-component-body"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;This code works:&lt;/P&gt;&lt;P&gt;%let datetime_start = %Sysfunc( InputN( 05MAR2017:23:59:12 , DateTime18. ) ) ;&lt;BR /&gt;%let datetime_end = %Sysfunc( InputN( 06MAR2017:00:01:31 , DateTime18. ) ) ;&lt;BR /&gt;%let Duration = %sysfunc(putn(%sysevalf(&amp;amp;datetime_end-&amp;amp;datetime_start.),mmss.)) (mm:ss) ;&lt;BR /&gt;%put PROCESSING TIME: %sysfunc(putn(%sysevalf(&amp;amp;datetime_end-&amp;amp;datetime_start.),mmss.)) (mm:ss) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I change to datetime(), it fails.&lt;/P&gt;&lt;P&gt;%let datetime_start = %sysfunc(DATETIME(),Datetime18.) ;&lt;BR /&gt;%put &amp;amp;datetime_start;&lt;BR /&gt;%let datetime_end = %sysfunc(DATETIME(),Datetime18.) ;&lt;BR /&gt;%put &amp;amp;datetime_end;&lt;BR /&gt;%let Duration = %sysfunc(putn(%sysevalf(&amp;amp;datetime_end-&amp;amp;datetime_start.),mmss.)) (mm:ss) ;&lt;BR /&gt;%put PROCESSING TIME: %sysfunc(putn(%sysevalf(&amp;amp;datetime_end-&amp;amp;datetime_start.),mmss.)) (mm:ss) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Errors:&lt;/P&gt;&lt;P&gt;1 %let datetime_start = %Sysfunc( InputN( 05MAR2017:23:59:12 , DateTime18. ) ) ;&lt;BR /&gt;2 %let datetime_end = %Sysfunc( InputN( 06MAR2017:00:01:31 , DateTime18. ) ) ;&lt;BR /&gt;3 %let Duration = %sysfunc(putn(%sysevalf(&amp;amp;datetime_end-&amp;amp;datetime_start.),mmss.)) (mm:ss) ;&lt;BR /&gt;4 %put PROCESSING TIME: %sysfunc(putn(%sysevalf(&amp;amp;datetime_end-&amp;amp;datetime_start.),mmss.)) (mm:ss) ;&lt;BR /&gt;PROCESSING TIME: 2:19 (mm:ss)&lt;BR /&gt;5 %let datetime_start = %sysfunc(DATETIME(),Datetime18.) ;&lt;BR /&gt;6 %put &amp;amp;datetime_start;&lt;BR /&gt;06MAR17:14:19:53&lt;BR /&gt;7 %let datetime_end = %sysfunc(DATETIME(),Datetime18.) ;&lt;BR /&gt;8 %put &amp;amp;datetime_end;&lt;BR /&gt;06MAR17:14:19:53&lt;BR /&gt;9 %let Duration = %sysfunc(putn(%sysevalf(&amp;amp;datetime_end-&amp;amp;datetime_start.),mmss.)) (mm:ss) ;&lt;BR /&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was:&lt;BR /&gt;06MAR17:14:19:53-06MAR17:14:19:53&lt;BR /&gt;ERROR: %SYSEVALF function has no expression to evaluate.&lt;BR /&gt;ERROR: Argument 1 to function PUTN referenced by the %SYSFUNC or %QSYSFUNC macro function is not a number.&lt;BR /&gt;ERROR: Invalid arguments detected in %SYSCALL, %SYSFUNC, or %QSYSFUNC argument list. Execution of %SYSCALL statement or %SYSFUNC or&lt;BR /&gt;%QSYSFUNC function reference is terminated.&lt;BR /&gt;10 %put PROCESSING TIME: %sysfunc(putn(%sysevalf(&amp;amp;datetime_end-&amp;amp;datetime_start.),mmss.)) (mm:ss) ;&lt;BR /&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was:&lt;BR /&gt;06MAR17:14:19:53-06MAR17:14:19:53&lt;BR /&gt;ERROR: %SYSEVALF function has no expression to evaluate.&lt;BR /&gt;ERROR: Argument 1 to function PUTN referenced by the %SYSFUNC or %QSYSFUNC macro function is not a number.&lt;BR /&gt;ERROR: Invalid arguments detected in %SYSCALL, %SYSFUNC, or %QSYSFUNC argument list. Execution of %SYSCALL statement or %SYSFUNC or&lt;BR /&gt;%QSYSFUNC function reference is terminated.&lt;BR /&gt;PROCESSING TIME: (mm:ss)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 06 Mar 2017 21:38:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Continuation-Re-Calculate-length-of-time-job-runs-over-midnight/m-p/338593#M77135</guid>
      <dc:creator>labin</dc:creator>
      <dc:date>2017-03-06T21:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Continuation -Re: Calculate length of time job runs-over midnight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Continuation-Re-Calculate-length-of-time-job-runs-over-midnight/m-p/338594#M77136</link>
      <description>&lt;P&gt;Remove the datetime18 formats. That's creating character variables, but if you leave it as numbers it will work fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let datetime_start = %sysfunc(DATETIME()) ;
%put &amp;amp;datetime_start;
%let datetime_end = %sysfunc(DATETIME()) ;
%put &amp;amp;datetime_end;

%let Duration = %sysevalf(&amp;amp;datetime_end - &amp;amp;datetime_start); ;
%put &amp;amp;duration; ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;See above, unformatted final answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. When including code, especially longer code please use a code block { i } to format the code.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 21:44:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Continuation-Re-Calculate-length-of-time-job-runs-over-midnight/m-p/338594#M77136</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-06T21:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Continuation -Re: Calculate length of time job runs-over midnight</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Continuation-Re-Calculate-length-of-time-job-runs-over-midnight/m-p/338856#M77252</link>
      <description>thank you!</description>
      <pubDate>Tue, 07 Mar 2017 15:53:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Continuation-Re-Calculate-length-of-time-job-runs-over-midnight/m-p/338856#M77252</guid>
      <dc:creator>labin</dc:creator>
      <dc:date>2017-03-07T15:53:20Z</dc:date>
    </item>
  </channel>
</rss>

