DATA Step, Macro, Functions and more

SAS Program Times

Reply
Regular Contributor
Posts: 212

SAS Program Times

Hi.  I'm looking for a way to insert the datetime at the beginning of my program into my Log and then again at the end of my program. Because I run the program on a shared server I'd like to record how long each run of my program takes. I know already it can vary greatly from day-to-day.  Can anyone suggest some code for this?

 

Any help would be appreciated!

Super User
Posts: 7,758

Re: SAS Program Times

Posted in reply to buechler66

The time() function gives you exact time (down to microseconds). eg

data _null_;
now = time();
put now time15.6;
run;

will provide an entry in the log with the exact current time.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 1 reply
  • 153 views
  • 0 likes
  • 2 in conversation