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.

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
  • 1 reply
  • 744 views
  • 0 likes
  • 1 in conversation