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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.