Help using Base SAS procedures

Time to execute on Footnote

Reply
Occasional Contributor HM3
Occasional Contributor
Posts: 9

Time to execute on Footnote

When a statement is submitted, I want to include Real time or CPU time in the footnote.How to go about it?
Super Contributor
Super Contributor
Posts: 3,174

Re: Time to execute on Footnote

You can use the SAS system option ALTLOG to capture a copy of the SAS log output to a file, and specify the FULLSTIMER option to reveal detailed statistics in the log. Then use a DATA step to parse the ALTLOG file, capturing the desired metrics. And lastly you will need to generate SAS macro variable(s) containing these SAS execution metrics.

Scott Barry
SBBWorks, Inc.
Valued Guide
Posts: 2,177

Re: Time to execute on Footnote

Scott
are you able to open the altlog (to parse it) before the session closesp
Respected Advisor
Posts: 3,799

Re: Time to execute on Footnote

It appears that you cannot.

[pre]
40 data _null_;
41 infile "%sysfunc(getoption(altlog))";
42 input;
43 list;
44 run;

ERROR: File is in use, C:\Documents and Settings\datanull\My Documents\My SAS Files\9.1\ALT.log.
NOTE: The SAS System stopped processing this step because of errors.
[/pre]

Then there is our old friend PROC PRINTTO.
Super Contributor
Super Contributor
Posts: 3,174

Re: Time to execute on Footnote

Posted in reply to data_null__
data _null_ is correct - disregard my post-reply about using ALTLOG - that is if you want to parse the current session's log.

Scott Barry
SBBWorks, Inc.
Occasional Contributor HM3
Occasional Contributor
Posts: 9

Re: Time to execute on Footnote

Please share the script
Valued Guide
Posts: 2,177

Re: Time to execute on Footnote

Posted in reply to data_null__
data null ;
that was my expectation.
I'm surprised Scott neither suggested proc printto, nor the more interesting proc scaproc (which might be able to collect also the cpu times iirc - if you have sas92)
Valued Guide
Posts: 2,177

Re: Time to execute on Footnote

sorry about my wishful thinking
apparently proc scaproc reports elapse time, not CPU
Occasional Contributor HM3
Occasional Contributor
Posts: 9

Re: Time to execute on Footnote

can u send me the script?
Valued Guide
Posts: 2,177

Re: Time to execute on Footnote

to what script do you refer
Ask a Question
Discussion stats
  • 9 replies
  • 192 views
  • 0 likes
  • 4 in conversation