<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ODS PDF/RTF and the REPORT procedure: break on space not word in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-RTF-and-the-REPORT-procedure-break-on-space-not-word/m-p/328300#M17819</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I'm just not sure why you are worrying so much about the length or the wrapping. I would not bother. If INDENT= is not what you want and you DO want the wrapped text to be indented, then the LEFTMARGIN= attribute does that, as shown below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6986iC8977F731DFACB0D/image-size/original?v=1.0&amp;amp;px=-1" alt="more_indent.png" title="more_indent.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Before you go into template land, you can experiment with CELLPADDING values and fonts in PROC REPORT and THEN, after you find the values that give you&amp;nbsp; the report you want, you can move them to a style template. The TABLE element will apply to the PROC&amp;nbsp; REPORT table. I like to start with the PROC REPORT attributes in the PROC REPORT code, so I can experiment to see which values I want to use and then, after that I move into template land.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here's my paper about tiptoeing through the templates:&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings09/227-2009.pdf&amp;nbsp;" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings09/227-2009.pdf&amp;nbsp;&lt;/A&gt; and the one on style templates: &lt;A href="https://support.sas.com/resources/papers/proceedings10/033-2010.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings10/033-2010.pdf&lt;/A&gt; .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; And, here's an example of wrapping long text along with using INDENT or LEFTMARGIN:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6987i7042FB26C1F0CF3B/image-size/original?v=1.0&amp;amp;px=-1" alt="longtext.png" title="longtext.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did turn on the border lines and interior table lines in the long text example so you could be assured that the INDENT and LEFTMARGIN were working as designed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I find that ODS and SAS do a good job of not splitting words at a bad place such that I do not need to over-control the text strings by inserting my own line breaks. The only time I really insert line breaks is when I want to "stack" information in one cell and control exactly where the line break will occur, such as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data newclass;
  set sashelp.class(obs=2);
  length newvar1 newvar2 $200;
  newvar1 = cat('Name: ',name,'~{newline 1}','Sex: ',sex,'~{newline 1}','Age: ',put(age,2.0));
  newvar2 = cat('Height:',put(height,5.1),'~{newline 1}','Weight: ',put(weight,5.1));
run;

ods escapechar='~';
proc report data=newclass;
column newvar1 newvar2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; Perhaps I am missing the big picture, but you're not showing all your code and all your data, but based on what you've indicated so far, I don't think you need to go down the REGEX road or insert your own NEWLINE characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;</description>
    <pubDate>Sun, 29 Jan 2017 21:14:05 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2017-01-29T21:14:05Z</dc:date>
    <item>
      <title>ODS PDF/RTF and the REPORT procedure: break on space not word</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-RTF-and-the-REPORT-procedure-break-on-space-not-word/m-p/328264#M17812</link>
      <description>&lt;P&gt;How can I avoid having&amp;nbsp;a word broken instead of the breaking on the white space before it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I thought about writing a PRXCHANGE function to substitute the first space before the non-space characters that exceed a certain length but that would probably challenge me and it would like have to be in a loop, since my Regex skills are functions, not superb &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would appreciate any suggestions or references.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Kevin&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS&amp;nbsp; I note that the documentation specifies:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4 class="xis-argument"&gt;FLOW&lt;/H4&gt;
&lt;DIV class="xis-argumentDescription"&gt;&lt;SPAN class="xis-paraSimpleFirst"&gt;wraps the value of a character variable in its column. The FLOW option honors the split character. If the text contains no split character, then PROC REPORT tries to split text at a blank.&lt;/SPAN&gt;
&lt;TABLE class="xis-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="xis-restriction"&gt;Restriction&lt;/TD&gt;
&lt;TD class="xis-summaryText"&gt;This option only affects the LISTING output. It has no affect on other ODS output.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 29 Jan 2017 00:53:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-RTF-and-the-REPORT-procedure-break-on-space-not-word/m-p/328264#M17812</guid>
      <dc:creator>KevinViel</dc:creator>
      <dc:date>2017-01-29T00:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: ODS PDF/RTF and the REPORT procedure: break on space not word</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-RTF-and-the-REPORT-procedure-break-on-space-not-word/m-p/328266#M17813</link>
      <description>&lt;P&gt;Kevin,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a chance that you have "asis=on" within your style?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2017 01:18:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-RTF-and-the-REPORT-procedure-break-on-space-not-word/m-p/328266#M17813</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-01-29T01:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: ODS PDF/RTF and the REPORT procedure: break on space not word</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-RTF-and-the-REPORT-procedure-break-on-space-not-word/m-p/328274#M17814</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Are you using INDENT= to do your indent or did you pad the sentence with blanks. I found that INDENT= worked for me. I tried fiddling with the WIDTH= value quite a bit and could not make it split "the" or "completed" as you experienced.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Also not sure why you included the doc reference on FLOW -- it is a LISTING only option and irrelevant to ODS PDF and other ODS destinations (sort of like HEADLINE, HEADSKIP, SPACING and SKIP -- just not used by any destination except LISTING).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6978i4C48120F7E0A66F7/image-size/original?v=1.0&amp;amp;px=-1" alt="width_indent.png" title="width_indent.png" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2017 03:41:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-RTF-and-the-REPORT-procedure-break-on-space-not-word/m-p/328274#M17814</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-01-29T03:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: ODS PDF/RTF and the REPORT procedure: break on space not word</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-RTF-and-the-REPORT-procedure-break-on-space-not-word/m-p/328297#M17818</link>
      <description>&lt;P&gt;Cynthia,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I included the documentation on Flow to let reader know that I was aware of this option and that, as you observed, is for the LISTING destination.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I should have given more details: Times New Roman, 10 pt, with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;class&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt; table from output&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="4"&gt; / &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;frame&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt; = hsides&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;rules&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt; = groups&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;cellpadding&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt; = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="4"&gt;2.0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="4"&gt;pt&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;cellspacing&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt; = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="4"&gt;0.5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="4"&gt;pt&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;borderwidth&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt; = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="4"&gt;1.0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="4"&gt;pt&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="4"&gt; background = color_list( &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="4"&gt;"BGT"&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt; )&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I am still weak on&amp;nbsp;TEMPLATEs, so I am not sure if the above applies to report.&amp;nbsp; It is legacy code that I&amp;nbsp;obtained&amp;nbsp;and 2.0 pt padding seems undesirable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I padded the variable value with blank spaces (PDF and RTF destinations).&amp;nbsp; I&amp;nbsp; found that when wrapping occurs, then the INDENT does not apply to the subsequent lines (as you show below). Instead, I manually inserted:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; row_1 = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New"&gt;" Subject had a clinically significant protocol deviation during the induction phase"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; row_1 = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New"&gt;" Subject had a clinically significant protocol deviation during^n the induction phase" ;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that my ODS ESCAPECHAR = "^" and three spaces follow "^n". The issue is that we might have listings of hundreds of pages.&amp;nbsp; I stumbled onto &lt;A href="http://www.pharmasug.org/proceedings/2012/CC/PharmaSUG-2012-CC22.pdf" target="_blank"&gt;http://www.pharmasug.org/proceedings/2012/CC/PharmaSUG-2012-CC22.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"A Macro to Indent and Hyphenate Lengthy Text in PROC REPORT" by Stanley Yuen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that Regex can get us pretty far:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;12528 data _null_ ;&lt;/P&gt;
&lt;P&gt;12529 length x $ 200 ;&lt;/P&gt;
&lt;P&gt;12530 x = " three little pigs" ;&lt;/P&gt;
&lt;P&gt;12531 x = prxchange( "s/(.*)(?:\s+)([\S]*)$/$1^n%sysfunc(repeat( %str( ) , 2 ))$2/o" , 1 , trim( x )) ;&lt;/P&gt;
&lt;P&gt;12532 put x $char40. ;&lt;/P&gt;
&lt;P&gt;12533 run ;&lt;/P&gt;
&lt;P&gt;three little^n pigs&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(With some flexibility, with the number of spaces ready to be replaced by a macro variable, complicating the code.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bummer, as you observed in a previous post, we'd need to use &amp;amp;nbsp since we are in HTML land so the leading three spaces are gone...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macro would to break on spaces, or if we allow, in words (using a hyphen), would not be that complicated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The big issue is length.&amp;nbsp; I spent some time reading about fonts because some asked me to predict how many characters would fit in a given column/table.&amp;nbsp; Fascinating, if you can believe it, but I like books and did not mind reading about printing presses (carrying over from my childhood when I found an old newpaper in New Hampshire that had those "funny" s's that look similar to f's with a base and&amp;nbsp;no line in the middle.&amp;nbsp; The only thing that I can think of at the moment is to use the least narrow and the widest (M?) characters to find a conservative length, but we have not guarantee other bytes, like symbols will not appear in the value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2017 19:58:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-RTF-and-the-REPORT-procedure-break-on-space-not-word/m-p/328297#M17818</guid>
      <dc:creator>KevinViel</dc:creator>
      <dc:date>2017-01-29T19:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: ODS PDF/RTF and the REPORT procedure: break on space not word</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-RTF-and-the-REPORT-procedure-break-on-space-not-word/m-p/328300#M17819</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I'm just not sure why you are worrying so much about the length or the wrapping. I would not bother. If INDENT= is not what you want and you DO want the wrapped text to be indented, then the LEFTMARGIN= attribute does that, as shown below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6986iC8977F731DFACB0D/image-size/original?v=1.0&amp;amp;px=-1" alt="more_indent.png" title="more_indent.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Before you go into template land, you can experiment with CELLPADDING values and fonts in PROC REPORT and THEN, after you find the values that give you&amp;nbsp; the report you want, you can move them to a style template. The TABLE element will apply to the PROC&amp;nbsp; REPORT table. I like to start with the PROC REPORT attributes in the PROC REPORT code, so I can experiment to see which values I want to use and then, after that I move into template land.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here's my paper about tiptoeing through the templates:&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings09/227-2009.pdf&amp;nbsp;" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings09/227-2009.pdf&amp;nbsp;&lt;/A&gt; and the one on style templates: &lt;A href="https://support.sas.com/resources/papers/proceedings10/033-2010.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings10/033-2010.pdf&lt;/A&gt; .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; And, here's an example of wrapping long text along with using INDENT or LEFTMARGIN:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6987i7042FB26C1F0CF3B/image-size/original?v=1.0&amp;amp;px=-1" alt="longtext.png" title="longtext.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did turn on the border lines and interior table lines in the long text example so you could be assured that the INDENT and LEFTMARGIN were working as designed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I find that ODS and SAS do a good job of not splitting words at a bad place such that I do not need to over-control the text strings by inserting my own line breaks. The only time I really insert line breaks is when I want to "stack" information in one cell and control exactly where the line break will occur, such as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data newclass;
  set sashelp.class(obs=2);
  length newvar1 newvar2 $200;
  newvar1 = cat('Name: ',name,'~{newline 1}','Sex: ',sex,'~{newline 1}','Age: ',put(age,2.0));
  newvar2 = cat('Height:',put(height,5.1),'~{newline 1}','Weight: ',put(weight,5.1));
run;

ods escapechar='~';
proc report data=newclass;
column newvar1 newvar2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; Perhaps I am missing the big picture, but you're not showing all your code and all your data, but based on what you've indicated so far, I don't think you need to go down the REGEX road or insert your own NEWLINE characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2017 21:14:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-RTF-and-the-REPORT-procedure-break-on-space-not-word/m-p/328300#M17819</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-01-29T21:14:05Z</dc:date>
    </item>
  </channel>
</rss>

