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

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 2 replies
  • 944 views
  • 0 likes
  • 3 in conversation