DATA Step, Macro, Functions and more

Can we change .lst file into word document file?

Accepted Solution Solved
Reply
Contributor
Posts: 53
Accepted Solution

Can we change .lst file into word document file?

HI,

 

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

 

Thanks,

Archana


Accepted Solutions
Solution
‎09-01-2016 01:21 PM
Super User
Posts: 19,789

Re: Can we change .lst file into word document file?

Posted in reply to ArchanaSudhir

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


All Replies
New Contributor
Posts: 4

Re: Can we change .lst file into word document file?

Posted in reply to ArchanaSudhir

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.

Super User
Posts: 11,343

Re: Can we change .lst file into word document file?

Posted in reply to ArchanaSudhir

 

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.

Solution
‎09-01-2016 01:21 PM
Super User
Posts: 19,789

Re: Can we change .lst file into word document file?

Posted in reply to ArchanaSudhir

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;
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 244 views
  • 1 like
  • 4 in conversation