SAS Tip: Program Run Time (Daily tip for 2024-Jul-14)

A couple of useful things to do with the current time:

1. Put it at the top and bottom of your program for a quick & easy way of seeing how long a program took to execute.

  %let datetime_start = %sysfunc(TIME()) ;
  %put START TIME: %sysfunc(datetime(),datetime14.);
  ... program code ...
  %put END TIME: %sysfunc(datetime(),datetime14.);
  %put PROCESSING TIME:  %sysfunc(putn(%sysevalf(%sysfunc(TIME())-&datetime_start.),mmss.)) (mm:ss) ;

2. It's also useful to put this in a footnote for output that will be archived.

  footnote2 "%sysfunc(datetime(),datetime14.)";

This tip was originally posted by Robert Matthews on 

READ this complete tip   Visit a random SAS tip

Start a topic
About these Tips
A "SAS tip" is a basic unit of information exchange between SAS users. The tips on this board come from, from SAS user conferences, from SAS blogs, and from freelance contributions from SAS users like you. We hope that you're able to always learn something new here!

» How you can contribute

Tip-o-meter: 63 tips