<?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 record time when sas program executes in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/record-time-when-sas-program-executes/m-p/73020#M21180</link>
    <description>hi,&lt;BR /&gt;
&lt;BR /&gt;
I want to record time when sas program executes into a variable. Like a time stamp. Is there a way to do it?</description>
    <pubDate>Wed, 23 Sep 2009 18:33:27 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-09-23T18:33:27Z</dc:date>
    <item>
      <title>record time when sas program executes</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/record-time-when-sas-program-executes/m-p/73020#M21180</link>
      <description>hi,&lt;BR /&gt;
&lt;BR /&gt;
I want to record time when sas program executes into a variable. Like a time stamp. Is there a way to do it?</description>
      <pubDate>Wed, 23 Sep 2009 18:33:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/record-time-when-sas-program-executes/m-p/73020#M21180</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-09-23T18:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: record time when sas program executes</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/record-time-when-sas-program-executes/m-p/73021#M21181</link>
      <description>You can use the DATETIME function to assign a variable when your program starts and then assign another variable when the program ends.  However, if these are multiple DATA/PROC steps, you will need to decide how to capture and represent your timestamp information - here is one example, using SAS macro variables:&lt;BR /&gt;
&lt;BR /&gt;
%let start = %sysfunc(putn(%sysfunc(datetime()),datetime21.2));&lt;BR /&gt;
data _null_;&lt;BR /&gt;
x = sleep(30);&lt;BR /&gt;
run;&lt;BR /&gt;
%let end = %sysfunc(putn(%sysfunc(datetime()),datetime21.2));&lt;BR /&gt;
%put program started: &amp;amp;start;&lt;BR /&gt;
%put program ended: &amp;amp;end;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 23 Sep 2009 20:28:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/record-time-when-sas-program-executes/m-p/73021#M21181</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-09-23T20:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: record time when sas program executes</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/record-time-when-sas-program-executes/m-p/73022#M21182</link>
      <description>Scott, I think you misread the question.&lt;BR /&gt;
&lt;BR /&gt;
Does&lt;BR /&gt;
STAMP=time();&lt;BR /&gt;
do what you want?&lt;BR /&gt;
&lt;BR /&gt;
Don't forget to add&lt;BR /&gt;
format STAMP time.;&lt;BR /&gt;
&lt;BR /&gt;
If you want the time be be constant throughout the table:&lt;BR /&gt;
retain STAMP;&lt;BR /&gt;
if _N_=1 then STAMP=time();</description>
      <pubDate>Thu, 24 Sep 2009 22:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/record-time-when-sas-program-executes/m-p/73022#M21182</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2009-09-24T22:28:14Z</dc:date>
    </item>
  </channel>
</rss>

