Hi:
For most SAS installations, the LISTING or OUTPUT window output is shown in SAS Monospace, not Courier New (unless you have changed your system defaults).
However, that is not the issue. You have 2 separate issues:
1) Office/Word (and that includes RTF documents opened in Word) converts all units of measure -- inches, cm, point sizes, etc to a unit of measure called TWIPS -- twentieths of a printer's point, so if you are attempting to second guess Word in font size, it is generally very difficult. Word doesn't just take into account the number of characters in a cell. It also takes into account the amount of space around the characters in a cell, the size of the border needed around the cell. In addition, when you use one of the "big three" ODS destinations -- HTML, RTF and PDF, ODS tries to "fit" output on the page horizontally, by ever so slightly adjusting those items (like cellpadding and cellspacing), particularly for paged destinations (which RTF is). -- This kind of behind-the-scenes adjustment will be VERY hard for you to replicate.
2) The issue of how you set width is partly a MOOT point, because WDTH=, the PROC REPORT option is ignored for most ODS DESTINATIONS, as described here:
http://support.sas.com/kb/2/549.html (WIDTH= is not listed in this TS note, however, it is listed on this page, which shows "workarounds" for how to simulate the options in ODS HTML, specifically:
http://support.sas.com/rnd/base/ods/templateFAQ/repoption.html
So, while your formula attempt was inventive, your WIDTH= option was ignored by ODS RTF. And WIDTH= in LISTING, does to some extent determine how many characters to use, so a value of "SUPERCALIFRAGILISTICEXPEALIDOCIOUS" would normally take 34 characters and in the LISTING window and ONLY in the LISTING window, could you limit the string to display only "SUPER" with WIDTH=5. ODS will NEVER restrict the display of a string based on a WIDTH or CELLWIDTH value.
If, for example, you wanted to limit the number of characters displayed to only 5, you would have to use FORMAT= with PROC REPORT, as shown in the example below.
Note, that Output #1 only restricts the display to SUPER in the LISTING destination. While Output #2, will restrict the display to SUPER in all destinations (including LISTING). Output #3, does NOT restrict the display to only the first xxx characters -- the cell width is set and then the variable value is displayed in that width, with automatic wrapping, if necessary. Also note that because of the conversion to TWIPS, the column size might be different in RTF than it is in PDF (the other paged destination, where horizontal measurement matters).
The bottom line is that setting cellwidth is somewhat of a trial and error proposition because it's almost impossible to completely replicate ODS behind the scene's work -and- the Word conversion to TWIPS. If you are having issues with fitting very wide output onto a horizontal page in PDF or RTF, then you might search previous forum postings for the string "very wide" in order to see my previous posting on this topic -- with other tips on changing cellpadding among other attributes.
cynthia
[pre]
data test;
length wordvar $34;
name = 'aaa';
wordvar = 'supercalifragilisticexpealidocious';
run;
ods listing;
ods rtf file='ts.rtf' ;
ods pdf file='ts.pdf' ;
ods html file='ts.html' style=sasweb;
proc report data=test nowd;
title '1) using width= ONLY works for LISTING';
column name wordvar;
define name / 'name';
define wordvar / 'wordvar' width=5;
run;
proc report data=test nowd;
title '2) using format to set number of chars to display';
column name wordvar;
define name / 'name';
define wordvar / 'wordvar' format=$5.;
run;
proc report data=test nowd;
title '3) using cellwidth to set cell size';
column name wordvar;
define name / 'name';
define wordvar / 'wordvar'
style(column)={cellwidth=.15in};
run;
ods _all_ close;
[/pre]