BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tpham
Quartz | Level 8

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.

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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 

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

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 

--
Paige Miller
Tom
Super User Tom
Super User

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 4978 views
  • 1 like
  • 3 in conversation