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

It looks like when PROC REPORT wraps a long text value, it will split values based on some word boundaries, e.g. "." and " ".

 

So:

 

data have ; 
  txt="AAAAAAAAAAAAA.BBBBBBBBBBBBB CCCCCCCCCCCCC"  ;
run ;

ods pdf file="%sysfunc(pathname(work))/mypdf.pdf" ;
proc report data=have ;
  columns txt ;
  define txt /style(column)=[cellwidth=2in];
run ;
ods pdf close ;

Splits the text into 3 lines when it wraps, and gives me a PDF that looks like:

mypdf.png

Is there an option where I can tell PROC REPORT not to split the value on any boundaries when it wraps?  Perhaps a style option for a particular column that says something like IgnoreWordBoundaries?

 

Basically I want to save vertical space by allowing text to wrap in the middle of a "word".  If the above example wasn't split on word boundaries, it would be two rows instead of 3.

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
Hi:
There's no option like that that I know of except for fiddling with the width or explicitly using ODS ESCAPECHAR and {newline} to explicitly put your own linebreaks into the string.
Cynthia

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
There's no option like that that I know of except for fiddling with the width or explicitly using ODS ESCAPECHAR and {newline} to explicitly put your own linebreaks into the string.
Cynthia
Quentin
Super User

Thanks @Cynthia_sas.  If you don't know of it, then I'm sure it's not there.  Maybe I'll put it in as a ballot item.  Of course for real words, breaking on word boundaries makes sense.  But in this case I've got a column that shows the name of a file passed by the user.  And they come up with some really creative long names with spaces and sometimes dots in them, that are wrapping funny. So I'd like to just treat it as a string of characters, rather than a string of words.

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2068 views
  • 0 likes
  • 2 in conversation