SAS Tip: Adding a date and time stamp message to the SAS Log (Daily tip for 2025-Sep-09)


SAS listing output contains date and time stamps at the top of each output page. However, the associated SAS logs do not. You can however add a date time stamp to the LOG using a couple of different methods.

 

* DATA Step;
data _null_;  
    datetime = datetime();
    put datetime= datetime18.;
run;

Or you can use the macro language.

 

%put Job Started Execution at %sysfunc(time(),timeampm.) on %sysfunc(date(),worddate.).;

Originally posted by Lpweaver on sasCommunity.org.

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 sasCommunity.org, 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: 65 tips