<?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: Compressing spaces in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Compressing-spaces/m-p/302774#M64263</link>
    <description>Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Wed, 05 Oct 2016 19:51:07 GMT</pubDate>
    <dc:creator>KiranMaddi</dc:creator>
    <dc:date>2016-10-05T19:51:07Z</dc:date>
    <item>
      <title>Compressing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compressing-spaces/m-p/302611#M64200</link>
      <description>&lt;P&gt;Hello all&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help! I am struggling to delete any spaces in the below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set want nobs = nobs ;
call symput('nobs',nobs);
stop;
run ;

%put &amp;amp;nobs;

%Macro split (nobs);
%do i = 1 %to &amp;amp;nobs ;
	Data _null_;
	length i 3 ;
	i = &amp;amp;i ;
	set Brands point=i;
		Call symput ('Dataset',Test);		
		stop ;
	run;

		proc sql exec;	
		create table &amp;amp;Dataset(keep = MISC_A_QTE_KEY &amp;amp;dataset:) 
		select * from DAY_DATA		
		&lt;STRONG&gt;where &amp;amp;Dataset._quote_commissionformula &amp;lt;&amp;gt; ' ';&lt;/STRONG&gt;
		disconnect from odbc;
		quit;
		run;
	%end;
%mend split;
%split(&amp;amp;nobs);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you can see the where statement in the proc sql statement , when I try to use a macro variable attached to a string(variable name) there are some trailing spaces in the macro variable which is giving me the follwing error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;73: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where 
      the error has occurred.
ERROR 73-322: Expecting an AS.
SYMBOLGEN:  Macro variable DATASET resolves to ZE       
NOTE: Line generated by the macro variable "DATASET".
34          ZE       _quote_commissionformula
                     ________________________
                     22
                     76
MPRINT(SPLIT):   create table ZE (keep = MISC_A_QTE_KEY ZE :) select * from DAY_DATA where ZE 
_quote_commissionformula &amp;lt;&amp;gt; ' ';
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, (, *, **, +, -, '.', /, &amp;lt;, &amp;lt;=, 
              &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, AND, EQ, EQT, GE, GET, GROUP, GT, GTT, HAVING, LE, LET, LT, LTT, NE, NET, 
              OR, ORDER, ^=, |, ||, ~=.  

ERROR 76-322: Syntax error, statement will be ignored.




&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As you can see above there is space after ZE . I have tried compbl,trim,compress and they didn't work. Please could somebody help me figure out this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also attached the dataset where the macro variables are feeding from.&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5153i7E284B959C39ECF2/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Capturexx.JPG" title="Capturexx.JPG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 12:48:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compressing-spaces/m-p/302611#M64200</guid>
      <dc:creator>KiranMaddi</dc:creator>
      <dc:date>2016-10-05T12:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compressing-spaces/m-p/302737#M64233</link>
      <description>&lt;P&gt;Instead of&lt;/P&gt;
&lt;P&gt;Call &lt;SPAN class="token function"&gt;symput&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'Dataset'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;Test&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;use&lt;/P&gt;
&lt;P&gt;Call &lt;SPAN class="token function"&gt;symputx&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'Dataset'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;Test&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;Call &lt;SPAN class="token function"&gt;symput&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'Dataset'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,strip(&lt;/SPAN&gt;Test)&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 17:45:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compressing-spaces/m-p/302737#M64233</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-05T17:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compressing-spaces/m-p/302774#M64263</link>
      <description>Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Wed, 05 Oct 2016 19:51:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compressing-spaces/m-p/302774#M64263</guid>
      <dc:creator>KiranMaddi</dc:creator>
      <dc:date>2016-10-05T19:51:07Z</dc:date>
    </item>
  </channel>
</rss>

