As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Tips:Adding a date and time stamp message to the SAS Log

From sasCommunity
Jump to: navigation, search


As part of the decommissioning effort for sasCommunity.org this article/tip has been migrated to communities.sas.com.

The new home for this article/tip is Adding a date and time stamp message to the SAS Log (https://communities.sas.com/t5/SAS-Tips-from-the-Community/SAS-Tip-Adding-a-date-and-time-stamp-message-to-the-SAS-Log/m-p/475840#M180)



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.).;
Submitted By Lpweaver (talk)