<?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: wrap text in text string in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/wrap-text-in-text-string/m-p/462837#M20962</link>
    <description>&lt;P&gt;Is this for a report? I believe the method varies slightly depending on the output destination, you usually use ODS ESCAPECHAR and then SPLIT as well specified within PROC REPORT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/59697"&gt;@jenim514&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need advise for how to wrap a text string to a new line before parenthesis:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Variable value looks like this with varying lengths but same value/parenthesis format:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;450 mg (450 mg TDD)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;want output to look like this in&amp;nbsp;output:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;450 mg &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(450 mg TDD)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I remember it is something like ~n but not sure how to use it?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 May 2018 20:22:08 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-05-16T20:22:08Z</dc:date>
    <item>
      <title>wrap text in text string</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/wrap-text-in-text-string/m-p/462828#M20960</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need advise for how to wrap a text string to a new line before parenthesis:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Variable value looks like this with varying lengths but same value/parenthesis format:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;450 mg (450 mg TDD)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;want output to look like this in&amp;nbsp;output:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;450 mg &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(450 mg TDD)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I remember it is something like ~n but not sure how to use it?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 20:05:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/wrap-text-in-text-string/m-p/462828#M20960</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2018-05-16T20:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: wrap text in text string</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/wrap-text-in-text-string/m-p/462833#M20961</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
k='450 mg (450 mg TDD)';
var=substr(k,1,index(k,'(')-1);
output;
var=substr(k,index(k,'('));
output;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;are you read a raw data or dataset? the above works if you are reading a dataset&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 20:14:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/wrap-text-in-text-string/m-p/462833#M20961</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-16T20:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: wrap text in text string</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/wrap-text-in-text-string/m-p/462837#M20962</link>
      <description>&lt;P&gt;Is this for a report? I believe the method varies slightly depending on the output destination, you usually use ODS ESCAPECHAR and then SPLIT as well specified within PROC REPORT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/59697"&gt;@jenim514&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need advise for how to wrap a text string to a new line before parenthesis:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Variable value looks like this with varying lengths but same value/parenthesis format:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;450 mg (450 mg TDD)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;want output to look like this in&amp;nbsp;output:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;450 mg &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(450 mg TDD)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I remember it is something like ~n but not sure how to use it?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 20:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/wrap-text-in-text-string/m-p/462837#M20962</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-16T20:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: wrap text in text string</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/wrap-text-in-text-string/m-p/462839#M20963</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;I'm sorry I need to clarify more &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 don't need two separate observations but rather I need&amp;nbsp; same line that will wrap to a new line in a report.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So maybe how can I add the ~n before the '(' ?&lt;/P&gt;
&lt;P&gt;k='450 mg ~n (450 mg TDD)';&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 20:24:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/wrap-text-in-text-string/m-p/462839#M20963</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2018-05-16T20:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: wrap text in text string</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/wrap-text-in-text-string/m-p/462845#M20964</link>
      <description>&lt;P&gt;Ok, I figured it out by just breaking the var into two variables, then inserting the escapechar&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;trt1= scan(trt01p,1,'(');&lt;BR /&gt;if trt01p ^='Placebo' then trt2=substr(trt01p,index(trt01p,'('));&lt;BR /&gt;newtrt= catx ('~n',trt1, trt2);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks all!&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 20:40:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/wrap-text-in-text-string/m-p/462845#M20964</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2018-05-16T20:40:09Z</dc:date>
    </item>
  </channel>
</rss>

