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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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