Hi
This is my sample program
proc printto log='/Desktop/alternate-log-file.log';
run;
Data test;
Input ID name $ Amount;
Datalines;
1 A 10
2 B 20
3 C 30
4 D 40
5 E 50
;
Run;
proc printto;
run;
I want to know how can I add current date and time timestamp in the name "alternate-log-file.log"?
Any suggestion.
Regards
Sourav
What type of timestamp, there are various formats. E.g.
proc printto log="/desktop/alternate_log_file_%sysfunc(now(),datetime.).log"; proc printto log="/desktop/alternate_log_file_%sysfunc(date(),date9.).log"; proc printto log="/desktop/alternate_log_file_%sysfunc(date(),e8601dt.).log";
What type of timestamp, there are various formats. E.g.
proc printto log="/desktop/alternate_log_file_%sysfunc(now(),datetime.).log"; proc printto log="/desktop/alternate_log_file_%sysfunc(date(),date9.).log"; proc printto log="/desktop/alternate_log_file_%sysfunc(date(),e8601dt.).log";
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.