<?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 variable for proc report purpose in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100479#M258068</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am aware that PROC REPORT has build in split option. My problem is when 2 columns is combined and must be displayd as one column and second column must have two spaces from the left. See example below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COL1: OTHER&lt;/P&gt;&lt;P&gt;COL2:THIS IS EXAMPLE WHY WRAPPING IS NEEDED&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMBINED COL:&lt;/P&gt;&lt;P&gt;OTHER&lt;/P&gt;&lt;P&gt;&amp;nbsp; THIS IS EXAMPLE&lt;/P&gt;&lt;P&gt;&amp;nbsp; WHY WRAPPING&lt;/P&gt;&lt;P&gt;&amp;nbsp; IS NEEDED&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my intention is to append two spaces and star: "&amp;nbsp; *" next I will use split, flow options to automatically wrap text in PROC REPORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everything was fine in above example, but strip function should be added to newline:&lt;/P&gt;&lt;P&gt;newline=strip(newline) || "*&amp;nbsp; "|| strip(word);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it works correctly! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Apr 2013 06:38:50 GMT</pubDate>
    <dc:creator>c44rl</dc:creator>
    <dc:date>2013-04-09T06:38:50Z</dc:date>
    <item>
      <title>Wrap text in variable for proc report purpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100473#M258062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a problem to wrap text for long variable. My aim is to obtain new variable with inserted char(i.e. "*") to split the variable in proc report. I try to use this code, but it still doesn't work. Could you please advice?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data x;&lt;/P&gt;&lt;P&gt;set sashelp.afmsg(keep=text);&lt;/P&gt;&lt;P&gt;length newline $ 1000;&lt;/P&gt;&lt;P&gt;newline = '';&lt;/P&gt;&lt;P&gt;len = 0; * Length of string begining from last *&lt;/P&gt;&lt;P&gt;nwords = countw(text, ' ');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* count loop;&lt;/P&gt;&lt;P&gt;do count = 1 to nwords;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; word = scan(text, count, ' ');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if len + 1 + length(word) &amp;gt; 30 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * append word and if &amp;gt;30 then insert '*';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newline = newline || '*' || word;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; len = length(word);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * if &amp;lt;30 then we do not required append *;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newline = newline || ' ' || word;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; len = len + length(word) + 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2013 08:08:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100473#M258062</guid>
      <dc:creator>c44rl</dc:creator>
      <dc:date>2013-04-08T08:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Wrap text in variable for proc report purpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100474#M258063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This program&lt;/P&gt;&lt;P&gt;&lt;A href="http://devenezia.com/downloads/sas/samples/split-into-words.sas" title="http://devenezia.com/downloads/sas/samples/split-into-words.sas"&gt;http://devenezia.com/downloads/sas/samples/split-into-words.sas&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Uses the approach of inserting split charcters. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2013 10:36:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100474#M258063</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-04-08T10:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Wrap text in variable for proc report purpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100475#M258064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just checking ... are you aware that PROC REPORT has a WRAP option as part of the column definitions?&amp;nbsp; It is capable of wrapping text without you having to split it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2013 14:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100475#M258064</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-04-08T14:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Wrap text in variable for proc report purpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100476#M258065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good point!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Back in the day when everything was .LST I used to do the splits so I could count them and control pagination.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2013 14:17:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100476#M258065</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-04-08T14:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Wrap text in variable for proc report purpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100477#M258066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, back in the good old days when PROC REPORT didn't exist and data_null_; was the only choice!&amp;nbsp; :smileylaugh:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2013 14:43:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100477#M258066</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-04-08T14:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Wrap text in variable for proc report purpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100478#M258067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No the good old days when PROC REPORT did exist but ODS did not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2013 18:10:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100478#M258067</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-04-08T18:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Wrap text in variable for proc report purpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100479#M258068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am aware that PROC REPORT has build in split option. My problem is when 2 columns is combined and must be displayd as one column and second column must have two spaces from the left. See example below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COL1: OTHER&lt;/P&gt;&lt;P&gt;COL2:THIS IS EXAMPLE WHY WRAPPING IS NEEDED&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMBINED COL:&lt;/P&gt;&lt;P&gt;OTHER&lt;/P&gt;&lt;P&gt;&amp;nbsp; THIS IS EXAMPLE&lt;/P&gt;&lt;P&gt;&amp;nbsp; WHY WRAPPING&lt;/P&gt;&lt;P&gt;&amp;nbsp; IS NEEDED&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my intention is to append two spaces and star: "&amp;nbsp; *" next I will use split, flow options to automatically wrap text in PROC REPORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everything was fine in above example, but strip function should be added to newline:&lt;/P&gt;&lt;P&gt;newline=strip(newline) || "*&amp;nbsp; "|| strip(word);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it works correctly! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 06:38:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wrap-text-in-variable-for-proc-report-purpose/m-p/100479#M258068</guid>
      <dc:creator>c44rl</dc:creator>
      <dc:date>2013-04-09T06:38:50Z</dc:date>
    </item>
  </channel>
</rss>

