BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AshWynn87
Fluorite | Level 6

Hello there.

I'm attempting to export an excel file with 3 sheets. There is a dataset that applies to each sheet as you can see below. The problem is that I'm getting word wrapping in the data. It doesn't happen in all cells, but it does in most. I've tried flow='data' in the options but SAS doesn't recognize it. How can I get this random word wrapping to stop?

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
AshWynn87
Fluorite | Level 6

I ended up fixing it with an alternative method. Thanks everyone!

View solution in original post

9 REPLIES 9
ballardw
Super User

Did you try removing the absolute_column_width or using NONE instead of setting to 9.

When you try to put more text than might fit I suspect that word wrap gets turned on.

AshWynn87
Fluorite | Level 6

I did try that to no avail.

ChrisNZ
Tourmaline | Level 20

Does your data contain carriage returns? Where does it come from? Do you need to clean it?

AshWynn87
Fluorite | Level 6

I've already cleaned the data. There's no distinct reason it should be wrapping.

ballardw
Super User

@AshWynn87 wrote:

I've already cleaned the data. There's no distinct reason it should be wrapping.


Can you provide some example data that duplicates this behavior in the form of a data step? This is very likely somewhat data dependent and without data we are kind of flying blind.

Replace any sensitive values with characters strings of the same length or random numbers of a similar range of digits.

Test the example data to show that the behavior is similar.

 

Likely we only need 5 or 10  rows of data as examples.

 

If you need help creating data step of your data Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

AshWynn87
Fluorite | Level 6

I ended up fixing it with an alternative method. Thanks everyone!

ChrisNZ
Tourmaline | Level 20

@AshWynn87  Can you explain so others benefit from your findings?

AshWynn87
Fluorite | Level 6

I used the same ods excel code in the initial post. I changed the code for assigning the variable by putting strip() around both vars included instead of around the whole thing.


Here's the code for assigning a variable, in this case varname RE_1:

Capture1.PNG

 

Here's the corresponding output for said variable:
Capture2.PNG

ChrisNZ
Tourmaline | Level 20

It looks like your data wasn't so clean after all and you should have applied the function compbl().

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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