BookmarkSubscribeRSS Feed
JuanVte
Calcite | Level 5
Hi everybody,

I am trying to have a realistic representation of what I will find in the RTF document compared with the SAS output.

For that, when I create a RTF file, I use Courier New 8pt. This font should be the same that we have in the SAS output.

The first problem is how to set the column width using proc report.

For the SAS output it can be set using option "width". This option sets the number of characters to be used. So if I want to write Peter, I will have enough doing width=5.

This option does not work in ods rtf, so we need the option
style(column)=[cellwidth=xx units]

The problem is that I am not able to relate the number of character in the option width with the number of unit in rtf.

I am trying to do this kind of reasoning:

- One character takes 8 points,
- 72 pt correspond to 1 inch,
- so 1 character takes 8/72 inch,
- so n characters takes n* 8/72 inch.

But it does not work.

I am using the following code:

%let width = 10;

ods rtf file="c:\temp\format.rtf";
proc report missing headline headskip nowd data=sashelp.class split='*';
columns name;
define name / display 'Name' style(column)=[cellwidth=%sysevalf(8/72 * &width)in] width=&width;
run;
ods rtf close;

Any idea??

Thanks!!
Juanvte
1 REPLY 1
JuanVte
Calcite | Level 5
Sorry, now I see that this post it is not in the correct place... I am going to move it.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1162 views
  • 0 likes
  • 1 in conversation