I'd like to record in SASLOG the date and time of running programs. I have a manual solution:
%put START TIME: %sysfunc(datetime(),datetime14.);
data temp;
x=1;
run;
proc print data=temp ;
run;
with the saslog:
81 %put START TIME: %sysfunc(datetime(),datetime14.);
START TIME: 29OCT17:13:14
82 data temp;
83 x=1;
84 run;
but I don't want to manually add %PUT every time I run a code. Instead, I would like to make a change in SASLOG configuration to get datetime stamp automatically with each run of any code opened in the SAS session.
I looked up OPTIONS DATE (attached) does not produce the date in the output nor saslog.
Many thanks for any hints!
Krzysztof
SAS already writes the starting time at the top of the log.
You could just add up the times for the previous steps if you really needed to figure out when a particular one started.
Otherwise use your method to add you own notes to the log.
Line 1 in the SAS log should show the start time BUT it's always the time when SAS got invoked. So that works nicely for batch jobs but doesn't give you a lot of useful information for other modes of running SAS.
You method looks good to me.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.