BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
AndersS
Lapis Lazuli | Level 10

Hi! Is there any good way to measure the cpu-time for a SAS program?

 

At present I look in the SAS log and add together

user cpu-time    and system cpu-time

 

/Best Regards AndersS

Anders Sköllermo (Skollermo in English)
1 ACCEPTED SOLUTION

Accepted Solutions
MargaretC
SAS Employee

That is the correct way to do it.  

View solution in original post

10 REPLIES 10
MargaretC
SAS Employee

That is the correct way to do it.  

Kurt_Bremser
Super User

If it is a batch program, wrap the sas commandline in the time command:

time /path_to_sas/sas -log /logpath/program.log -sysin /progpath/program.sas
SASKiwi
PROC Star

With batch SAS logs a total real and CPU time for the whole job is printed at the end.

Tom
Super User Tom
Super User

@SASKiwi wrote:

With batch SAS logs a total real and CPU time for the whole job is printed at the end.


Exactly:

>tail -n5  sassy.log
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
      real time           1:17.30
      cpu time            6.09 seconds

AndersS
Lapis Lazuli | Level 10

Hi!  I use "SAS on Demand for Academics". Many thanks!  / AndersS

Anders Sköllermo (Skollermo in English)
AndersS
Lapis Lazuli | Level 10
Hi!  I use "SAS on Demand for Academics". Many thanks!  / AndersS
Anders Sköllermo (Skollermo in English)
AhmedAl_Attar
Ammonite | Level 13

Hi @AndersS 

I know you marked this as solved, but if you wanted to have more elaborate measurements displayed in the log, you can use

 

options fullstimer;

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostunx/n0k7vnqt9p9o91n1jsl23a08l13e.htm

 

 

AndersS
Lapis Lazuli | Level 10
Many thanks! /Br AndersS
Anders Sköllermo (Skollermo in English)
Kurt_Bremser
Super User

System CPU time is the time used by kernel calls (like the very basic read() or write() functions), while user CPU is the time spent in the non-system code. It is therefore correct to add both numbers up to get the whole CPU used by a process (or a SAS program step).

AndersS
Lapis Lazuli | Level 10
Many thanks! I am working a a FAST method for quantiles on LARGE amounts of data. / BR AndersS
Anders Sköllermo (Skollermo in English)

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 10 replies
  • 1786 views
  • 8 likes
  • 6 in conversation