Help using Base SAS procedures

control the cellwidth in proc tabulate that is printed in .rtf

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

control the cellwidth in proc tabulate that is printed in .rtf

With the attached code we construct our table that is afterwards exported into a *.rtf document.

As you can see we use a format ("cellwidth").

 

the table should cover 100% of the horizontal width. We tried different numbers to get the right width of every cell but we can't figure out how sas allocates / computes the cellwidths. As it is not like we dictate with our format.

 

Is there some experience / advice out there?

 

Thank you in advance

 

Attachment

Accepted Solutions
Solution
‎02-27-2017 08:34 AM
Super User
Posts: 10,500

Re: control the cellwidth in proc tabulate that is printed in .rtf

For a question like this I would suggest providing some example data, ods destination and options in effect, values for the macro variables and/or remove most of the options that don't have much affect on this appearance such as border colors, borderwidths, font information to reduce the code to the key elements related to the question.

Also if you get any messages in the log that might help.

 

You should also include the actual format, at least enough for the values in the example data. In the format I might look for things that aren't valid for the cellwidth parameter

 

Since the only place I see the $cellwidth format is in a classlev statement what happens if you set a fixed value instead of the format

 

View solution in original post


All Replies
Solution
‎02-27-2017 08:34 AM
Super User
Posts: 10,500

Re: control the cellwidth in proc tabulate that is printed in .rtf

For a question like this I would suggest providing some example data, ods destination and options in effect, values for the macro variables and/or remove most of the options that don't have much affect on this appearance such as border colors, borderwidths, font information to reduce the code to the key elements related to the question.

Also if you get any messages in the log that might help.

 

You should also include the actual format, at least enough for the values in the example data. In the format I might look for things that aren't valid for the cellwidth parameter

 

Since the only place I see the $cellwidth format is in a classlev statement what happens if you set a fixed value instead of the format

 

New Contributor
Posts: 2

Re: control the cellwidth in proc tabulate that is printed in .rtf

thank you for your help!

 

Our problem was mainly that we used ods tagsets.rtf_sample rather than tagsets.rtf.


 

SAS Super FREQ
Posts: 8,743

Re: control the cellwidth in proc tabulate that is printed in .rtf

Hi:

  For an example of using the WIDTH= option, there's an example below. I find that width=100% works, no matter what the destination. For destinations that respect the margin settings (PDF, RTF, PRINTER, TAGSETS.RTF) I find it works better not to "over-control" the width and just use a simple WIDTH=100% on the TABLE statement as shown below. (When I look inside Word, at the margin settings, the margins are correctly set at .5 in all around and the width=100% works as I expect.

 

cynthia

 

set_width.png

☑ This topic is SOLVED.

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

Discussion stats
  • 3 replies
  • 131 views
  • 0 likes
  • 3 in conversation