SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
zimcom
Pyrite | Level 9

 

Good Friday everyone!

 

I use ODS excel to generate a report, but the text in some of the columns got automatically wrapped like the example below: 

 

Worsening of Congestive
heart failure
Cardiac failure
congestive

 

Is there a way to control not let the ODS wrap the text, or I can control the width of the columns through style (data)?

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
koyelghosh
Lapis Lazuli | Level 10
ODS Excel FILE="NameAndPathOfTheFile.xlsx" OPTIONS(FLOW='Tables');
   /* PROC or DATA step here */
ODS Excel Close;

Please let me know, how was the output. I don't have Microsoft Excel to confirm whether it worked or not.

View solution in original post

6 REPLIES 6
koyelghosh
Lapis Lazuli | Level 10

May be FLOW='Tables' as an option in ODS Excel will help!! The link is here (http://support.sas.com/kb/59/351.html)

koyelghosh
Lapis Lazuli | Level 10
ODS Excel FILE="NameAndPathOfTheFile.xlsx" OPTIONS(FLOW='Tables');
   /* PROC or DATA step here */
ODS Excel Close;

Please let me know, how was the output. I don't have Microsoft Excel to confirm whether it worked or not.

zimcom
Pyrite | Level 9

@koyelghosh 

Thank you, the FLOW='Tables' not working for me probably because of the SAS version (I am using SAS 9.4), but I used the "style width = ", and it worked perfect!

Thank you @koyelghosh again and BIG thanks to the entire SAS programming community for the tremendous helps/supports I have been getting throughtout the years!

 

ccabalbag
Calcite | Level 5

Hello,  Can you elaborate how to use "style with" to unwrapped text?  

 

Thanks.

 

zimcom
Pyrite | Level 9

first, you need to combine the data using '^n' as below:

 

CSA = catx('^n', country, sex, age);

 

then, using the ods option to define the escapechar

options ods escapechar='^';

 

last, you will have 

Country/Sex/Age

Canada
Male
89

 

I hope this works for you

dknochen
Fluorite | Level 6
flow='tables' worked well, thank you!

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
  • 6 replies
  • 23026 views
  • 3 likes
  • 4 in conversation