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: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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