<?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: space at the end of string by exporting excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/space-at-the-end-of-string-by-exporting-excel/m-p/611277#M178134</link>
    <description>You can just use the DSD FILE statement option and forget all the rest.  Look it up.</description>
    <pubDate>Thu, 12 Dec 2019 12:52:58 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2019-12-12T12:52:58Z</dc:date>
    <item>
      <title>space at the end of string by exporting excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/space-at-the-end-of-string-by-exporting-excel/m-p/611255#M178117</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
input category ~ $15. amount ;
datalines ;
REGUL 15
DEPNONDTX3 32
;
run;



%macro mc_export_xls ;

PROC CONTENTS DATA = have
OUT = work.dictionnaire
NOPRINT ;
RUN ;

PROC SQL noprint ;
	SELECT COMPBL(name!!
		CASE
			WHEN (type=1 AND
			format IS MISSING)
			THEN " NUMX12.9 "
		WHEN (type=1) THEN " "!!
		COMPRESS(cats(format,formatL,".",formatD," "))
		ELSE ""
		END)
		,
	QUOTE(LEFT(TRIM(COALESCE(label,name)))),
		COUNT(*),
		MAX(nobs)+1
	INTO : variables SEPARATED BY " '09'x ",
		: en_tete SEPARATED BY " '09'x ",
		: nbVar ,
		: nbObs
	FROM work.dictionnaire
		ORDER BY varnum
	;
Quit;

FILENAME xlData "&amp;amp;RESULT.have.xls";

DATA _NULL_ ;
FILE xlData DROPOVER lrecl=50000  encoding= 'WE8MSWIN1252' ;
SET have ;
PUT &amp;amp;variables ;
run ;
%mend ;


%mc_export_xls ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with a characters string column. by exporting the dataset , a character space appaers at the end of the text.&lt;/P&gt;&lt;P&gt;How could I prevent this space ?&lt;/P&gt;&lt;P&gt;thanks in advance for your help&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Nasser&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 11:17:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/space-at-the-end-of-string-by-exporting-excel/m-p/611255#M178117</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2019-12-12T11:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: space at the end of string by exporting excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/space-at-the-end-of-string-by-exporting-excel/m-p/611277#M178134</link>
      <description>You can just use the DSD FILE statement option and forget all the rest.  Look it up.</description>
      <pubDate>Thu, 12 Dec 2019 12:52:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/space-at-the-end-of-string-by-exporting-excel/m-p/611277#M178134</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-12-12T12:52:58Z</dc:date>
    </item>
  </channel>
</rss>

