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

HI,

 

Can we change .lst file into word document file? so that it is easier to share?

 

Thanks,

Archana

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

I would recommend switching to ODS RTF instead, by embedding your code between ODS RTF statements. 

RTF files can be opened by Word.

 

ods rtf file='sample.rtf' style=meadow bodytitle;

title 'this is my sample output';
proc means data=sashelp.class;
run;

title 'this is a different table';
proc freq data=sashelp.cars;
table make*model/list;
run;

ods rtf close;

View solution in original post

3 REPLIES 3
DocSteve
Obsidian | Level 7

One way, I'm sure not the only way, is  use ODS and set the output destination to html and from there you can read the file into MS-Word, MS-Excel, and a lot of other things.  It's two steps, but I do not seem to recall ever seeing .docx as an ODS destination.

ballardw
Super User

 

ods rtf file="C:\path\documentname.rtf";

 

/* any procedures that generate list output*/

 

ods rtf close;

 

Will send all of the procedures withing the ODS "sandwich" (ods rtf/ ods rtf close statements) to the specified file. Word reads RTF files.

 

Note that you have options to change the ODS style which controls font, fontsize, color and other appearance option as well as behviors for titles (in Word header or body of document) and others.

Reeza
Super User

I would recommend switching to ODS RTF instead, by embedding your code between ODS RTF statements. 

RTF files can be opened by Word.

 

ods rtf file='sample.rtf' style=meadow bodytitle;

title 'this is my sample output';
proc means data=sashelp.class;
run;

title 'this is a different table';
proc freq data=sashelp.cars;
table make*model/list;
run;

ods rtf close;

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
  • 3 replies
  • 2306 views
  • 1 like
  • 4 in conversation