<?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: Export to an excel file without trimming in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/533310#M6164</link>
    <description>Looks like it's a leading space you want to keep. Try ODS EXCEL, with PROC REPORT to generate the data and a $CHAR format instead applied to the column of interest.You could also try applying a CHAR format first and exporting, but I suspect Excel will remove that as well.</description>
    <pubDate>Wed, 06 Feb 2019 15:53:22 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-02-06T15:53:22Z</dc:date>
    <item>
      <title>Export to an excel file without trimming</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/533067#M6134</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to export 3 different tables into 3 sheet of the same excel file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The new version of sas is trimming one column during the export;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;export&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=WORK.BEN_CONSO_FAMILLE_02 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;outfile&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;RepertoireGlobal.\&amp;amp;Offre.\1. Données source\&amp;amp;AnneeMois.\4_4_BENEFICIAIRES_CONSOMMANT"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DBMS&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=xlsx &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;REPLACE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SHEET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Source_Prest_Benef_Cons_Famille"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;export&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=WORK.BEN_CONSO_TOTAL_FAMILLE_02 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;outfile&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;RepertoireGlobal.\&amp;amp;Offre.\1. Données source\&amp;amp;AnneeMois.\4_4_BENEFICIAIRES_CONSOMMANT"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DBMS&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=xlsx &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;REPLACE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SHEET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Source_Prest_Benef_Cons_Total"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;export&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=WORK.BEN_CONSO_PAR_AP_02 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;outfile&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;RepertoireGlobal.\&amp;amp;Offre.\1. Données source\&amp;amp;AnneeMois.\4_4_BENEFICIAIRES_CONSOMMANT"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DBMS&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=xlsx &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;REPLACE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SHEET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Source_Prest_Benef_Cons_AP"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;thank you in advance for your help&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 20:25:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/533067#M6134</guid>
      <dc:creator>othman</dc:creator>
      <dc:date>2019-02-05T20:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Export to an excel file without trimming</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/533076#M6136</link>
      <description>&lt;P&gt;In order for us to be able to help, I think we need a bit more information. It would be nice to have a few observations of each of the data sets being exported to test with, and an example of what you mean when you say "sas is trimming one column during the export". Does that mean one column is left out of the Excel tab, that the trailing blanks in text columns are not in the Excel file or perhaps one or more of the columns is being truncated? A small copy of the offending Excel file (or a least a screen shot showing the problem) would help get a more rapid response .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can DATA step program to create the sample data for you using the %data2datastep macro - see the article "&lt;SPAN class="lia-link-navigation blog-article-link lia-link-disabled"&gt;&lt;A href="How%20to create a data step version of your data AKA generate sample data for forums " target="_self"&gt;How to create a data step version of your data AKA generate sample data for forums&lt;/A&gt;"&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All the best,&lt;/P&gt;
&lt;P&gt;Mark&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 20:38:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/533076#M6136</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2019-02-05T20:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Export to an excel file without trimming</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/533080#M6138</link>
      <description>&lt;P&gt;PROC EXPORT doesn't 'trim' anything during the export process, it shouldn't change the input, except perhaps to strip formats.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you explain what you mean by TRIMMING? Have you verified your source data is as expected using PROC PRINT?&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/260135"&gt;@othman&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to export 3 different tables into 3 sheet of the same excel file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The new version of sas is trimming one column during the export;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;export&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=WORK.BEN_CONSO_FAMILLE_02 &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;outfile&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;"&amp;amp;RepertoireGlobal.\&amp;amp;Offre.\1. Données source\&amp;amp;AnneeMois.\4_4_BENEFICIAIRES_CONSOMMANT"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;DBMS&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=xlsx &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;REPLACE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;SHEET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;"Source_Prest_Benef_Cons_Famille"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;export&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=WORK.BEN_CONSO_TOTAL_FAMILLE_02 &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;outfile&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;"&amp;amp;RepertoireGlobal.\&amp;amp;Offre.\1. Données source\&amp;amp;AnneeMois.\4_4_BENEFICIAIRES_CONSOMMANT"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;DBMS&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=xlsx &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;REPLACE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;SHEET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;"Source_Prest_Benef_Cons_Total"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;export&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=WORK.BEN_CONSO_PAR_AP_02 &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;outfile&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;"&amp;amp;RepertoireGlobal.\&amp;amp;Offre.\1. Données source\&amp;amp;AnneeMois.\4_4_BENEFICIAIRES_CONSOMMANT"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;DBMS&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=xlsx &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;REPLACE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;SHEET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;"Source_Prest_Benef_Cons_AP"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;thank you in advance for your help&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 21:08:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/533080#M6138</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-05T21:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Export to an excel file without trimming</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/533164#M6148</link>
      <description>&lt;P&gt;Yes of course,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you will find attached a sample including :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The Data imported&lt;/LI&gt;&lt;LI&gt;The data seen in the sas GUI and expected.&lt;/LI&gt;&lt;LI&gt;The data after export.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically the program import the data and run som procedure to calculte the amount displayed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The matter is within the "TrimCptbl" column that i have created in SAS.&amp;nbsp;However After using the proc export or a print export the blank is erased.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in Advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
   CREATE TABLE WORK.BEN_CONSO_FAMILLE_02 AS 
   SELECT DISTINCT t1.AnneeSurv, 
          t1.College, 
          t1.Couverture, 
          t1.Garantie, 
          t1.TypeBenef, 
          t1.Famille, 
          /* AnneeCptbl */
            (FLOOR(t1.MIN_of_AnneeTrimCptbl/10)) AS AnneeCptbl, 
         &lt;FONT face="arial black,avant garde"&gt; /* TrimCptbl */
            (" T" || put( MOD(t1.MIN_of_AnneeTrimCptbl, 10) , 1.)) AS TrimCptbl, &lt;/FONT&gt;          /* NbBenefConso */
            (COUNT(t1.'Id Beneficiaire'n)) AS NbBenefConso, 
          /* MntRC */
            (SUM(t1.SUM_of_MntRC)) FORMAT=COMMAX8.2 AS MntRC, 
          /* NbActes */
            (SUM(t1.SUM_of_NbActes)) FORMAT=BEST12. AS NbActes, 
          /* NbActesOptions */
            (SUM(t1.SUM_of_NbActesOptions)) FORMAT=BEST12. AS NbActesOptions
      FROM WORK.BEN_CONSO_FAMILLE_01 t1
      WHERE t1.SUM_of_NbActes NOT = 0 OR t1.SUM_of_NbActesOptions NOT = 0
      GROUP BY t1.AnneeSurv,
               t1.College,
               t1.Couverture,
               t1.Garantie,
               t1.TypeBenef,
               t1.Famille,
               (CALCULATED AnneeCptbl),
               (CALCULATED TrimCptbl);
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 08:11:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/533164#M6148</guid>
      <dc:creator>othman</dc:creator>
      <dc:date>2019-02-06T08:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Export to an excel file without trimming</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/533310#M6164</link>
      <description>Looks like it's a leading space you want to keep. Try ODS EXCEL, with PROC REPORT to generate the data and a $CHAR format instead applied to the column of interest.You could also try applying a CHAR format first and exporting, but I suspect Excel will remove that as well.</description>
      <pubDate>Wed, 06 Feb 2019 15:53:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/533310#M6164</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-06T15:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Export to an excel file without trimming</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/533358#M6169</link>
      <description>&lt;P&gt;One way is to use ASIS=ON style element with ODS output.&lt;/P&gt;
&lt;P&gt;Let's make some sample data with leading spaces.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input a b $ c ;
  if a then b=repeat(' ',a-1)||b ;
  format b $char8.;
cards;
0 T 1
1 T 2
2 T 3
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now if we just print it with the $CHAR format attached the values look fine in the listing output.&lt;/P&gt;
&lt;PRE&gt;Obs    a    b         c

 1     0    T         1
 2     1     T        2
 3     2      T       3&lt;/PRE&gt;
&lt;P&gt;But not in the "pretty" ODS outputs.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 175px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26911i46611B71B5604379/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If we add style option&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods excel file="&amp;amp;path\test3.xlsx" ;
proc report data=test;
 column _all_;
 define a / display;
 define b / display style(column)=[asis=on]  ;
 define c / display;
run;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then leading spaces will appear in HTML and EXCEL destinations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 162px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26912i4595969CBD7C4DC1/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 18:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/533358#M6169</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-02-06T18:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Export to an excel file without trimming</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/534430#M6326</link>
      <description>&lt;P&gt;So, the trick is to apply the $CHAR3. format to the TrimCptbl column when you create it. This will cause SAS to preserve the leading space then the value is presented to Excel during PROC EXPORT. For example:&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
   CREATE TABLE WORK.BEN_CONSO_FAMILLE_02 AS 
   SELECT DISTINCT t1.AnneeSurv, 
          t1.College, 
          t1.Couverture, 
          t1.Garantie, 
          t1.TypeBenef, 
          t1.Famille, 
          /* AnneeCptbl */
            (FLOOR(t1.MIN_of_AnneeTrimCptbl/10)) AS AnneeCptbl, 
          /* TrimCptbl */
            (" T" || put( MOD(t1.MIN_of_AnneeTrimCptbl, 10) , 1.)) FORMAT=$CHAR3. AS TrimCptbl, /* NbBenefConso */
            (COUNT(t1.'Id Beneficiaire'n)) AS NbBenefConso, 
          /* MntRC */
            (SUM(t1.SUM_of_MntRC)) FORMAT=COMMAX8.2 AS MntRC, 
          /* NbActes */
            (SUM(t1.SUM_of_NbActes)) FORMAT=BEST12. AS NbActes, 
          /* NbActesOptions */
            (SUM(t1.SUM_of_NbActesOptions)) FORMAT=BEST12. AS NbActesOptions
      FROM WORK.BEN_CONSO_FAMILLE_01 t1
      WHERE t1.SUM_of_NbActes NOT = 0 OR t1.SUM_of_NbActesOptions NOT = 0
      GROUP BY t1.AnneeSurv,
               t1.College,
               t1.Couverture,
               t1.Garantie,
               t1.TypeBenef,
               t1.Famille,
               (CALCULATED AnneeCptbl),
               (CALCULATED TrimCptbl);
QUIT;

proc export 
   data=WORK.BEN_CONSO_FAMILLE_02 
   outfile= "&amp;amp;RepertoireGlobal.\&amp;amp;Offre.\1. Données source\&amp;amp;AnneeMois.\4_4_BENEFICIAIRES_CONSOMMANT"
   DBMS=xlsx REPLACE;
   SHEET="Source_Prest_Benef_Cons_Famille";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;May the SAS be with you!&lt;/P&gt;
&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 12:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Export-to-an-excel-file-without-trimming/m-p/534430#M6326</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2019-02-11T12:29:27Z</dc:date>
    </item>
  </channel>
</rss>

