<?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: Lines Wrapping in ODS Excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559696#M156336</link>
    <description>Thank you for much for your suggestions. Is there a way that the text wraps according to the widths of the two columns?</description>
    <pubDate>Fri, 17 May 2019 15:29:43 GMT</pubDate>
    <dc:creator>superbibi</dc:creator>
    <dc:date>2019-05-17T15:29:43Z</dc:date>
    <item>
      <title>Lines Wrapping in ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559486#M156226</link>
      <description>&lt;P&gt;Hi, I want to add footnotes in the table as new lines and wondering how I can wrap lines in accordance with the cell width setting?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data forglm(keep=person gender y1-y4)
formixed(keep=person gender visit y);
input person gender$ y1-y4;
output forglm;
y=y1; visit=1; output formixed;
y=y2; visit=2; output formixed;
y=y3; visit=3; output formixed;
y=y4; visit=4; output formixed;
datalines;
1 F 21.0 20.0 21.5 23.0
2 F 21.0 21.5 24.0 25.5
3 F 20.5 24.0 24.5 26.0
4 F 23.5 24.5 25.0 26.5
5 F 21.5 23.0 22.5 23.5
6 F 20.0 21.0 21.0 22.5
7 F 21.5 22.5 23.0 25.0
8 F 23.0 23.0 23.5 24.0
9 F 20.0 21.0 22.0 21.5
10 F 16.5 19.0 19.0 19.5
11 F 24.5 25.0 28.0 28.0
12 M 26.0 25.0 29.0 31.0
13 M 21.5 22.5 23.0 26.5
14 M 23.0 22.5 24.0 27.5
15 M 25.5 27.5 26.5 27.0
16 M 20.0 23.5 22.5 26.0
17 M 24.5 25.5 27.0 28.5
18 M 22.0 22.0 24.5 26.5
19 M 24.0 21.5 24.5 25.5
20 M 23.0 20.5 31.0 26.0
21 M 27.5 28.0 31.0 31.5
22 M 23.0 23.0 23.5 25.0
23 M 21.5 23.5 24.0 28.0
24 M 17.0 24.5 26.0 29.5
25 M 22.5 25.5 25.5 26.0
26 M 23.0 24.5 26.0 30.0
27 M 22.0 21.5 23.5 25.0
;


proc report data = formixed;
column person visit;

define person/ display CENTER
                 style(column)=[cellwidth=0.5in];
                 
define visit/ display CENTER
                 style(column)=[cellwidth=0.5in];
                                  
 compute after _page_/ style={just=left};

    line "long long long long long long long long long line";
  endcomp;

run;


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 May 2019 20:44:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559486#M156226</guid>
      <dc:creator>superbibi</dc:creator>
      <dc:date>2019-05-16T20:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Lines Wrapping in ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559499#M156233</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117839"&gt;@superbibi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I want to add footnotes in the table as new lines and wondering how I can wrap lines in accordance with the cell width setting?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data forglm(keep=person gender y1-y4)
formixed(keep=person gender visit y);
input person gender$ y1-y4;
output forglm;
y=y1; visit=1; output formixed;
y=y2; visit=2; output formixed;
y=y3; visit=3; output formixed;
y=y4; visit=4; output formixed;
datalines;
1 F 21.0 20.0 21.5 23.0
2 F 21.0 21.5 24.0 25.5
3 F 20.5 24.0 24.5 26.0
4 F 23.5 24.5 25.0 26.5
5 F 21.5 23.0 22.5 23.5
6 F 20.0 21.0 21.0 22.5
7 F 21.5 22.5 23.0 25.0
8 F 23.0 23.0 23.5 24.0
9 F 20.0 21.0 22.0 21.5
10 F 16.5 19.0 19.0 19.5
11 F 24.5 25.0 28.0 28.0
12 M 26.0 25.0 29.0 31.0
13 M 21.5 22.5 23.0 26.5
14 M 23.0 22.5 24.0 27.5
15 M 25.5 27.5 26.5 27.0
16 M 20.0 23.5 22.5 26.0
17 M 24.5 25.5 27.0 28.5
18 M 22.0 22.0 24.5 26.5
19 M 24.0 21.5 24.5 25.5
20 M 23.0 20.5 31.0 26.0
21 M 27.5 28.0 31.0 31.5
22 M 23.0 23.0 23.5 25.0
23 M 21.5 23.5 24.0 28.0
24 M 17.0 24.5 26.0 29.5
25 M 22.5 25.5 25.5 26.0
26 M 23.0 24.5 26.0 30.0
27 M 22.0 21.5 23.5 25.0
;


proc report data = formixed;
column person visit;

define person/ display CENTER
                 style(column)=[cellwidth=0.5in];
                 
define visit/ display CENTER
                 style(column)=[cellwidth=0.5in];
                                  
 compute after _page_/ style={just=left};

    line "long long long long long long long long long line";
  endcomp;

run;


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So which cell is this supposed to align with?&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 21:53:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559499#M156233</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-16T21:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Lines Wrapping in ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559500#M156234</link>
      <description>&lt;P&gt;Hi, I'm not sure what you mean. The cellwidth for a LINE statement text is the same as the width of the entire table because the output from a LINE statement spans the entire table. Where do you want the line to wrap? When I run your code, this is what I see (at the top):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diff_methods_line.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29582i41079C87F923381E/image-size/large?v=v2&amp;amp;px=999" role="button" title="diff_methods_line.png" alt="diff_methods_line.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;But, as you see in my second example, there are 2 methods to use the LINE statement and get the code to "wrap" to a certain point. Method 1 using ODS ESCAPECHAR (yellow highlight) and Method 2 uses multiple LINE statements (pink highlight).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Notice how the LINE statement text stays within the "boundary" of the table. This is not the same as Footnote statement behavior. A footnote statement would be outside the boundary of the table and in paged destinations like PDF and RTF would be at the bottom of the page.&lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 22:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559500#M156234</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-05-16T22:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lines Wrapping in ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559694#M156334</link>
      <description>&lt;P&gt;Thank you for the response. I would like to &lt;SPAN&gt;align&amp;nbsp;with the widths of the two columns.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 15:28:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559694#M156334</guid>
      <dc:creator>superbibi</dc:creator>
      <dc:date>2019-05-17T15:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Lines Wrapping in ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559696#M156336</link>
      <description>Thank you for much for your suggestions. Is there a way that the text wraps according to the widths of the two columns?</description>
      <pubDate>Fri, 17 May 2019 15:29:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559696#M156336</guid>
      <dc:creator>superbibi</dc:creator>
      <dc:date>2019-05-17T15:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Lines Wrapping in ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559747#M156363</link>
      <description>&lt;P&gt;Honestly, I don't understand what you mean, the text from a LINE statement spans the entire table -- so it spans BOTH columns in your example. There's not a way to control the LINE statement and treat it like it has 2 cells (which is what it sounds like you want).&lt;BR /&gt;&lt;BR /&gt;You did not show your ODS statements, so I'm not sure what ODS EXCEL options you might be trying to use in addition to your PROC REPORT code.&lt;BR /&gt;&lt;BR /&gt;There is another way to do it with Break processing, but it's more complicated and the issue is that since you've limited your Person column to only .5 in, the line is going to wrap very badly, like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="long_line_vs_span_table.png" style="width: 205px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29603i2109867A64CD5C20/image-size/large?v=v2&amp;amp;px=999" role="button" title="long_line_vs_span_table.png" alt="long_line_vs_span_table.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;if you use the break method.&lt;BR /&gt;&lt;BR /&gt;So that does not seem useful.&lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 19:15:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559747#M156363</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-05-17T19:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Lines Wrapping in ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559781#M156375</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am starting to think that perhaps &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117839"&gt;@superbibi&lt;/a&gt;&amp;nbsp;is not clearly stating the issue quite clearly. I think the complaint is that a long line of text will make the two data columns wider than desired, as specified with cell widths,&amp;nbsp;while the long line extends the table width to fit text as a single line. At least in HTML. I didn't try any other destinations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 20:08:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559781#M156375</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-17T20:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Lines Wrapping in ODS Excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559812#M156385</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Well, in HTML it does look like the line is stretching the table. I posted HTML output. I did NOT post any ODS EXCEL output because the OP did NOT provide any guidance on what ODS EXCEL options/suboptions might be in effect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; When I run my code to Excel, the line wraps across both cells and both cells look what I would expect for .5in:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="long_in_XLSX.png" style="width: 229px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29610i9944E2D257E30D0C/image-size/large?v=v2&amp;amp;px=999" role="button" title="long_in_XLSX.png" alt="long_in_XLSX.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;as you can see, the 3 LINE statements from my initial code do wrap within the widths of the 2 columns -- here's the output WITHOUT any line statements in Excel:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="long_no_lines.png" style="width: 206px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29611iE29BF2A55AD3E763/image-size/large?v=v2&amp;amp;px=999" role="button" title="long_no_lines.png" alt="long_no_lines.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So it looks to me like the LINE statement is NOT causing the same issue in ODS EXCEL as in ODS HTML.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;and with just the ORIGINAL LINE statement in the mix, I see this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="long_one_line.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29612i98F3B075884F0E18/image-size/large?v=v2&amp;amp;px=999" role="button" title="long_one_line.png" alt="long_one_line.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, in Excel, the cell widths seem consistent across all forms of LINE or not LINE statements in the code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 22:20:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Lines-Wrapping-in-ODS-Excel/m-p/559812#M156385</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-05-17T22:20:57Z</dc:date>
    </item>
  </channel>
</rss>

