<?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: Calculate times on test session in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculate-times-on-test-session/m-p/497369#M131807</link>
    <description>&lt;P&gt;I found this here: &lt;A href="https://blogs.sas.com/content/sgf/2015/01/21/sas-timer-the-key-to-writing-efficient-sas-code/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2015/01/21/sas-timer-the-key-to-writing-efficient-sas-code/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;Get your own SAS timer&lt;/H1&gt;
&lt;OL&gt;
&lt;LI&gt;At the very beginning of your SAS program, place the following line of code that effectively starts the timer and remembers the start time:&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;/* Start timer */&lt;/P&gt;
&lt;P&gt;%let _timer_start = %sysfunc(datetime());&lt;/P&gt;
&lt;OL start="2"&gt;
&lt;LI&gt;At the end of your SAS program place the following code snippet that captures the end time, calculates duration and outputs it to the SAS Log:&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;/* Stop timer */&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; dur = datetime() - &amp;amp;_timer_start;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; put 30*'-' / ' TOTAL DURATION:' dur time13.2 / 30*'-';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt; The resulting output in the SAS log will look like this:&lt;/P&gt;
&lt;P&gt;------------------------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;TOTAL DURATION:&amp;nbsp;&amp;nbsp; 0:01:31.02&lt;/P&gt;
&lt;P&gt;------------------------------&lt;/P&gt;</description>
    <pubDate>Thu, 20 Sep 2018 14:14:55 GMT</pubDate>
    <dc:creator>tomrvincent</dc:creator>
    <dc:date>2018-09-20T14:14:55Z</dc:date>
    <item>
      <title>Calculate times on test session</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-times-on-test-session/m-p/497365#M131804</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have certain test sessions with a start and end time. Different tests are performed on the session. These tests also have a beginning and an end time. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now I want to calculate how much time before, within and after the session falls. The hours and minutes may also be in decimals. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I calculate this in Excel, but I want to calculate this in EG now. Do you see opportunities to make this possible? In EG these are two separate tables (Sessions and To_test).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;See my example in Excel. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 13:48:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-times-on-test-session/m-p/497365#M131804</guid>
      <dc:creator>HansSteenhuis</dc:creator>
      <dc:date>2018-09-20T13:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate times on test session</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-times-on-test-session/m-p/497369#M131807</link>
      <description>&lt;P&gt;I found this here: &lt;A href="https://blogs.sas.com/content/sgf/2015/01/21/sas-timer-the-key-to-writing-efficient-sas-code/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2015/01/21/sas-timer-the-key-to-writing-efficient-sas-code/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;Get your own SAS timer&lt;/H1&gt;
&lt;OL&gt;
&lt;LI&gt;At the very beginning of your SAS program, place the following line of code that effectively starts the timer and remembers the start time:&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;/* Start timer */&lt;/P&gt;
&lt;P&gt;%let _timer_start = %sysfunc(datetime());&lt;/P&gt;
&lt;OL start="2"&gt;
&lt;LI&gt;At the end of your SAS program place the following code snippet that captures the end time, calculates duration and outputs it to the SAS Log:&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;/* Stop timer */&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; dur = datetime() - &amp;amp;_timer_start;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; put 30*'-' / ' TOTAL DURATION:' dur time13.2 / 30*'-';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt; The resulting output in the SAS log will look like this:&lt;/P&gt;
&lt;P&gt;------------------------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;TOTAL DURATION:&amp;nbsp;&amp;nbsp; 0:01:31.02&lt;/P&gt;
&lt;P&gt;------------------------------&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 14:14:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-times-on-test-session/m-p/497369#M131807</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2018-09-20T14:14:55Z</dc:date>
    </item>
  </channel>
</rss>

