<?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: Remove Spaces in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89635#M19021</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reeza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using EG and strip() or trim() didn't not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create table test as&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; t1.Modified,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;right&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;(trim(t1.Modified)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; trim_Value, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; Work.table t1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;EG Code Generated for filter:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;Select * From test&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;WHERE&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; t1.trim_Value = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;'00000102&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 May 2013 18:06:00 GMT</pubDate>
    <dc:creator>newbi</dc:creator>
    <dc:date>2013-05-29T18:06:00Z</dc:date>
    <item>
      <title>Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89633#M19019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Afternoon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have column name ‘modified’ which is character type with Length (in bytes) of 11.&amp;nbsp; Not all the value stored has 11 characters.&amp;nbsp; When I try to filter table by modify value I always have to include space for filter to work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example: if the value is ‘ABCD’ then for filter I would have to include ‘ABCD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ‘ (7 empty space).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I remove these leading spaces from table or source file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 17:33:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89633#M19019</guid>
      <dc:creator>newbi</dc:creator>
      <dc:date>2013-05-29T17:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89634#M19020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You say filter, are you in EG or somewhere else?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The strip() or trim() function can be used to remove spaces from a variable. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 17:44:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89634#M19020</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-05-29T17:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89635#M19021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reeza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using EG and strip() or trim() didn't not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create table test as&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; t1.Modified,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;right&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;(trim(t1.Modified)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; trim_Value, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; Work.table t1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;EG Code Generated for filter:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;Select * From test&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;WHERE&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; t1.trim_Value = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;'00000102&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 18:06:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89635#M19021</guid>
      <dc:creator>newbi</dc:creator>
      <dc:date>2013-05-29T18:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89636#M19022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to do it on the fly, otherwise, the new variable you just made will inherit the original length, meaning it will still have the trailing blanks. So try this:&lt;/P&gt;&lt;P&gt;SELECT DISTINCT t1.Modified,right(trim(t1.Modified)) as trim_Value,&lt;/P&gt;&lt;P&gt;FROM Work.table t1;&lt;/P&gt;&lt;P&gt;EG Code Generated for filter:&lt;/P&gt;&lt;P&gt;Select * From test&lt;/P&gt;&lt;P&gt;WHERE strip( t1.Modified) = '00000102'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 18:42:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89636#M19022</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-05-29T18:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89637#M19023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to stored the date without trailing blank ? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 20:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89637#M19023</guid>
      <dc:creator>newbi</dc:creator>
      <dc:date>2013-05-29T20:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89638#M19024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, define a shorter length for your new variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT DISTINCT t1.Modified,left(t1.Modified)) as trim_Value length=8, &lt;/P&gt;&lt;P&gt;FROM Work.table t1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 20:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89638#M19024</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-05-29T20:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89639#M19025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not very familiar with EG, but if that is SAS code then it doesn't make sense. In SAS if I test if variable X = 'TEXT' it will be true whether X is defined as length 4 or 4000.&amp;nbsp; The trailing spaces are ignored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible that the coders for EG have ignored 30 years of SAS experience on how to compare character variables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 20:56:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89639#M19025</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-05-29T20:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89640#M19026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suppose OP is confused on Leading/Trailing blanks. In the first post, "leading spaces" did have been mentioned, although the example presented is about "Trailing blanks". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 21:02:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89640#M19026</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-05-29T21:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89641#M19027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for the confusion. It's trailing space not the leading spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hai.Kuo - i can't define shorter length because some values are 8 space where others are 11.,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 21:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89641#M19027</guid>
      <dc:creator>newbi</dc:creator>
      <dc:date>2013-05-29T21:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89642#M19028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clean up the source data by applying the trim function, then try it again. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 21:17:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89642#M19028</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-05-29T21:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89643#M19029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then you will have 3 blanks for those have 8, unless you want to truncate those have 11. I understand you are learning the concept, but I can't fathom the reason why that matters practically?&lt;/P&gt;&lt;P&gt;Also, if it is only trailing blanks, then you will have to answer the question from Tom. When doing comparison, trailing blanks should NOT matter at all, even in EG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 21:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89643#M19029</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-05-29T21:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89644#M19030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this example will show that the spaces aren't necessarily in the data but how the variable is referenced can create the added spaces. Ifyou run the code below the results will show significantly different values for the LONGSTR variable, one with spaces that were not assigned to the variable A. For some uses SAS will pad the variable to it's length with spaces. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;data _null_; &lt;/P&gt;&lt;P&gt;file print;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;length a $ 8 longstr $ 50;; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a = 'abc'; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;longstr = 'This '||a||'string'; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put longstr=; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;longstr = 'This '||strip(a)||'string'; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put longstr=; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 22:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89644#M19030</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-05-29T22:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89645#M19031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;
&lt;P&gt;newbi wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Reeza,&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I'm using EG and strip() or trim() didn't not work.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Create table test as&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; t1.Modified,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;right&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;(trim(t1.Modified)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; trim_Value, &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; Work.table t1;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;EG Code Generated for filter:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;Select * From test&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;WHERE&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; t1.trim_Value = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;'00000102&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;The right() function is suspicious.&amp;nbsp; This would right justify a character variable, which would create leading spaces, which *are* significant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;create table test as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: 'Courier New';"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: 'Courier New';"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New';"&gt; t1.Modified,strip(t1.Modified) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: 'Courier New';"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New';"&gt; trim_Value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: 'Courier New';"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New';"&gt; Work.table t1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This should then work, regardless of whether EG is padding the generated values with trailing spaces - trailing spaces are not significant:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: 'Courier New';"&gt;Select * From test&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: 'Courier New';"&gt;WHERE&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New';"&gt; t1.trim_Value = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: 'Courier New';"&gt;'00000102&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, you could just use the function directly in the where clause:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: 'Courier New';"&gt;Select * From test&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: 'Courier New';"&gt;WHERE&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New';"&gt; strip(t1.trim_Value) = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: 'Courier New';"&gt;'00000102&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But since that is EG generated code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect your source data has character data that contains leading spaces.&amp;nbsp; Or sometimes non-printing control characters can be problematic; you could try reviewing your data using the $hex. format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 09:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89645#M19031</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2013-05-30T09:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89646#M19032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it's very simple if your charcter variable includes leading or trailing blanks...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WHERE compress(var_name) = "Compare Value";&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 11:04:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89646#M19032</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2013-05-30T11:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89647#M19033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you google "SAS Character Functions", there is an excellent .pdf file from the SAS support web site that explains all of the character functions in SAS (including functions that eliminate various types of spaces).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2013 15:25:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89647#M19033</guid>
      <dc:creator>statguy22</dc:creator>
      <dc:date>2013-05-30T15:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89648#M19034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This would not give the correct results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try WHERE compress("&amp;nbsp;&amp;nbsp; Compare Value&amp;nbsp;&amp;nbsp; ") = "Compare Value" to see what I mean.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jun 2013 09:07:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89648#M19034</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2013-06-02T09:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89649#M19035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Tom&lt;/P&gt;&lt;P&gt;SAS EG is mainly a "SAS code generator" having a lot of wizards helping you to generate valid code (eg. a query builder) which then gets executed on the server you choose. &lt;/P&gt;&lt;P&gt;I've just tried using the EG query builder and there is no issue with trailing blanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jun 2013 10:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89649#M19035</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-06-02T10:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89650#M19036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You shouldn't be having a problem with this. Here's an example that works for me in EG:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Bring SASHELP.SHOES into your project. If you check the properties for the dataset, the Product field is 14 long.&lt;/P&gt;&lt;P&gt;2. Start the Filter and Sort task against SASHELP.SHOES.&lt;/P&gt;&lt;P&gt;3. Select all of the columns for the result, and select the Filter tab. In Filter, set Product Equal to Boot (note the capitalization matters.) Don't change anything else, and run the query. It should work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The filter in Query Builder works on this example as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us know what happens when you try this.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jun 2013 17:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Spaces/m-p/89650#M19036</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2013-06-02T17:34:09Z</dc:date>
    </item>
  </channel>
</rss>

