<?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 ODS Excel - problem with wrap text in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576058#M163021</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the ODS excel to export some data from SAS to Excel. I have a "problem" which is not so terrible but a little contraignant :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it always wrap the text...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked the documentation (&lt;A href="https://documentation.sas.com/?docsetId=odsug&amp;amp;docsetTarget=p09n5pw9ol0897n1qe04zeur27rv.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=odsug&amp;amp;docsetTarget=p09n5pw9ol0897n1qe04zeur27rv.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;) and tryied to use the instruction FLOW which is not working...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to "delete" the wrapping text &lt;SPAN&gt;without necessarily having to define the length of all the cells ?&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="QmZWSe"&gt;&lt;DIV class="DHcWmd"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="DHcWmd"&gt;Many thanks..&lt;/DIV&gt;&lt;DIV class="DHcWmd"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="DHcWmd"&gt;Onizuka&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 24 Jul 2019 08:06:47 GMT</pubDate>
    <dc:creator>Onizuka</dc:creator>
    <dc:date>2019-07-24T08:06:47Z</dc:date>
    <item>
      <title>ODS Excel - problem with wrap text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576058#M163021</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the ODS excel to export some data from SAS to Excel. I have a "problem" which is not so terrible but a little contraignant :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it always wrap the text...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked the documentation (&lt;A href="https://documentation.sas.com/?docsetId=odsug&amp;amp;docsetTarget=p09n5pw9ol0897n1qe04zeur27rv.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=odsug&amp;amp;docsetTarget=p09n5pw9ol0897n1qe04zeur27rv.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;) and tryied to use the instruction FLOW which is not working...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to "delete" the wrapping text &lt;SPAN&gt;without necessarily having to define the length of all the cells ?&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="QmZWSe"&gt;&lt;DIV class="DHcWmd"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="DHcWmd"&gt;Many thanks..&lt;/DIV&gt;&lt;DIV class="DHcWmd"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="DHcWmd"&gt;Onizuka&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 24 Jul 2019 08:06:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576058#M163021</guid>
      <dc:creator>Onizuka</dc:creator>
      <dc:date>2019-07-24T08:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - problem with wrap text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576093#M163024</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269468"&gt;@Onizuka&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you could use the option&amp;nbsp;absolute_column_width='20' to set the width for all columns to a certain width.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looks kind of strange too me but that is the beauty of ods.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 09:48:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576093#M163024</guid>
      <dc:creator>Criptic</dc:creator>
      <dc:date>2019-07-24T09:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - problem with wrap text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576094#M163025</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/50279"&gt;@Criptic&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269468"&gt;@Onizuka&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you could use the option&amp;nbsp;absolute_column_width='20' to set the width for all columns to a certain width.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looks kind of strange too me but that is the beauty of ods.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/50279"&gt;@Criptic&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply ! The problem using width = 20 is that is set all columns, but i have some columns which needs 40 characters, others 3 etc..&lt;/P&gt;&lt;P&gt;So, ods is very pretty but sometimes it sucks !! haha&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 09:54:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576094#M163025</guid>
      <dc:creator>Onizuka</dc:creator>
      <dc:date>2019-07-24T09:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - problem with wrap text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576095#M163026</link>
      <description>&lt;P&gt;In that case you could comma seperate the numbers of the cell - I guess you could via proc contens get the value of the column name count the length and then create a macro-variable which contains all these number seperated by commas and plug that into the ods statement - seems like a lot of trouble put hey - if there is a will there is a way &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 09:58:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576095#M163026</guid>
      <dc:creator>Criptic</dc:creator>
      <dc:date>2019-07-24T09:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - problem with wrap text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576100#M163028</link>
      <description>&lt;P&gt;I have already try to do this, the problem is (and I don't know why) that when i use a proc contents on my table, the order of columns is not the same than the real table ! wtf haha&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 10:57:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576100#M163028</guid>
      <dc:creator>Onizuka</dc:creator>
      <dc:date>2019-07-24T10:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - problem with wrap text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576101#M163029</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269468"&gt;@Onizuka&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have already try to do this, the problem is (and I don't know why) that when i use a proc contents on my table, the order of columns is not the same than the real table ! wtf haha&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;May be using order=varnum in proc contents will give you the same order.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 11:03:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576101#M163029</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-07-24T11:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - problem with wrap text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576103#M163030</link>
      <description>Ordering by varnum is the way to go here, because for some strange reason proc contents orders alphabetically by default</description>
      <pubDate>Wed, 24 Jul 2019 11:11:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576103#M163030</guid>
      <dc:creator>Criptic</dc:creator>
      <dc:date>2019-07-24T11:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - problem with wrap text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576130#M163041</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/50279"&gt;@Criptic&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Ordering by varnum is the way to go here, because for some strange reason proc contents orders alphabetically by default&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Ah, yes indeed it is possible like that haha&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm testing, I hope the wrapping text will stop but i don't think so !! I'm coming later to tell if it works or not !&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 12:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576130#M163041</guid>
      <dc:creator>Onizuka</dc:creator>
      <dc:date>2019-07-24T12:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - problem with wrap text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576144#M163046</link>
      <description>&lt;P&gt;Okey, it seems to work ! Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/50279"&gt;@Criptic&lt;/a&gt; and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp; for your answers &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;For all people that have the same problem, this is the steps I have used :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* 1) proc contents to recover the length of each variables */
proc contents data = table_you_want_export 
out = other_name (keep = varnum length) noprint ; 
run ;

/* sorting by varnum to have the same order that the table you want export */
proc sort data = other_name ; 
by varnum ; 
run ;
	
/* creating a macro variable containing these lengths separated by a comma */
proc sql noprint ; 
select length into : length_var separated by ',' 
from other_name ; 
quit ;

/* EXPORT */

ods excel file="path\name_output.xlsx" 
options(
flow = "header, data" 
absolute_column_width = "&amp;amp;length_var" 
absolute_row_height = "20px"
); 

Proc print data = table_you_want_export noobs ;
run ;

ods excel close ;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 13:09:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576144#M163046</guid>
      <dc:creator>Onizuka</dc:creator>
      <dc:date>2019-07-24T13:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - problem with wrap text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576227#M163079</link>
      <description>&lt;P&gt;If you use the Proc Contents option ORDER=VARNUM then you don't need the sort step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data = table_you_want_export 
  out = other_name (keep = varnum length) 
  noprint 
  order=varnum
  ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also get all the information directly from dictionary.columns&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
  select length into : length_var separated by ',' 
  from dictionary.columns
  where libname='&amp;lt;LIBREF OF TABLE_YOU_WANT_EXPORT in uppercase&amp;gt;' 
        and memname='&amp;lt;NAME OF TABLE_YOU_WANT_EXPORT in uppercase&amp;gt;'
  order by varnum
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 16:12:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576227#M163079</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-07-24T16:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: ODS Excel - problem with wrap text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576479#M163181</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thanks for you answer, the "order = varnum" in the proc contents doesn't work for me, it doesn't sort the table !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the second program you made is perfect ! Thanks &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 have the reflex to go through metadatas !&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 07:23:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ODS-Excel-problem-with-wrap-text/m-p/576479#M163181</guid>
      <dc:creator>Onizuka</dc:creator>
      <dc:date>2019-07-25T07:23:32Z</dc:date>
    </item>
  </channel>
</rss>

