DATA Step, Macro, Functions and more

SAS Program Times

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: 10,258

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;

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

Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation