Date: Thu, 4 Aug 2005 12:47:56 -0700
Reply-To: tanwan <tanwanzang@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: tanwan <tanwanzang@YAHOO.COM>
Organization: http://groups.google.com
Subject: Re: cpu time
In-Reply-To: <1123179725.099647.183550@o13g2000cwo.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"
The PRINTTO procedure can send the log to a file you specify. The NEW
word ensures that this file is replaced. In its absence the output is
appended to the file if it already exists.
You may then scan that file and read the time used (in seconds). In
this example it is stored in data TimeUsed, and is available for
further use in the same SAS session or another session.
Submitting
PROC PRINTTO;
RUN; will re-direct the log and output to the default destinations.
options stimer ls=256 ps=256;
proc printto new LOG = 'c:\temp\saslog.txt';run;
/*** INCLUDE THE PROCEDURE(S) WHOSE DURATION YOU NEED HERE ***/
proc printto;run;
data TimeUsed;
infile 'c:\temp\saslog.txt';
input @'PROCEDURE' procedure $;
input @'real time' realtime;
input @'cpu time' cputime;
;
proc print data=TimeUsed;
run;