BookmarkSubscribeRSS Feed
SASGeek
Obsidian | Level 7

Hello,

I've written a program that outputs 6 tabs in one spreadsheet and I would like the contents to be as formatted as possible before sending them on to the recipients. I'd rather not do post processing but can't seem to get it right.

 

So what methods do you recommend for me to determine the width and height of a column (no wrapping of text) to get optimum results? I've tried the FLOW='tables' suboption but even that has required some post processing. I've tried determining the width after using a PROC CONTENTS and using the length, and again, a good start, but. . .

 

Also, is there a way to auto-adjust the height as well the way flow= "tables" adjusts?

 

Thank you

2 REPLIES 2
ballardw
Super User

I would say a better approach is to control the column width when created. But that would depend on how you are creating the output and would require showing your code.

 

IF, and this is likely a very big if, all of these sheets are essentially the same you could try using the absolute column widths in the options of OD Excel. If the reports are similar then that approach would work by setting the widths of longest expected values as the column widths.

 

Note that column width depends on more than variable length. The font used to display the text comes into play as well.

PaigeMiller
Diamond | Level 26

In ODS EXCEL you have options such as ABSOLUTE_COLUMN_WIDTH and ABSOLUTE_ROW_HEIGHT to fix the width and height. Typically, if I find a specific column is too wide, or not wide enough, I make a second pass with adjusted values for ABSOLOUTE_COLUMN_WIDTH.

 

There's also this: Solved: Lines Wrapping in ODS Excel - Page 2 - SAS Support Communities

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 138 views
  • 0 likes
  • 3 in conversation