Hi I would like to know how to export sas program log to a folder using sas code in a sas program
right now I have to manually export it and I would like to use sas code to have it automatically saved in a specific folder
please help thx
proc printto log="g:\abc\def\myfolder\filename.log" new;
run;
/* YOUR CODE GOES HERE */
proc printto;
run;
Note: the option NEW overwrites any previous logs by this name.
proc printto log="g:\abc\def\myfolder\filename %sysfunc(today(), yymmddn10.).log" new;
run;
/* YOUR CODE GOES HERE */
proc printto;
run;
You can also add the date (or datetime via datetime()) if you're looking to have this tracked each time you run a process.
@HeatherNewton please mark an answer correct, if the answer works for you.
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.