I start all my code by clearing the results fine using "dm 'odsresults; clear';" as specified on this page. I was wondering is there a way to save the results as a lst file (instead of clicking on output, file=>Save AS) via syntax?
I am able to do it for automatically save the log file automatically by using the "DM LOG" command and specifying a file location/name at the end of my code. I can't seem figure out a way to do it for results/LST file, so wondering if anyone can show me how.
Is something like this what you are looking for? Place this at the beginning of your program, or at any point within the program where you want the .LST file to begin.
ods listing file="\\server\folder\example1.lst";
and as the last line of code, or anywhere where you want the creation of the .LST file to stop
ods listing close;
Or you can use PROC PRINTTO
Is something like this what you are looking for? Place this at the beginning of your program, or at any point within the program where you want the .LST file to begin.
ods listing file="\\server\folder\example1.lst";
and as the last line of code, or anywhere where you want the creation of the .LST file to stop
ods listing close;
Or you can use PROC PRINTTO
Are you asking for the DM command to save the LOG to a file? You could use the FILE command. But it general for the LOG and OUTPUT windows it is better to use the PRINT command since then the formfeeds are inserted between the pages.
dm 'log; print file="myprogram.log"; ';
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.