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?
I ended up fixing it with an alternative method. Thanks everyone!
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.
I did try that to no avail.
Does your data contain carriage returns? Where does it come from? Do you need to clean it?
I've already cleaned the data. There's no distinct reason it should be wrapping.
@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.
I ended up fixing it with an alternative method. Thanks everyone!
@AshWynn87 Can you explain so others benefit from your findings?
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:
Here's the corresponding output for said variable:
It looks like your data wasn't so clean after all and you should have applied the function compbl().
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.