<?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 removing space in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/removing-space/m-p/216554#M5277</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am bringing the data from oracle. one of the character variable has value like&lt;/P&gt;&lt;P&gt;abc 25&lt;/P&gt;&lt;P&gt;spc 26&lt;/P&gt;&lt;P&gt; xy 20 &lt;/P&gt;&lt;P&gt;I have used strip unction to remove the space. But when I compare the data with source value doesn't match. Also tried TRIMN(LEFT()). One more thing I don't want to delete the space between the values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Jun 2015 20:02:15 GMT</pubDate>
    <dc:creator>Ishaan</dc:creator>
    <dc:date>2015-06-29T20:02:15Z</dc:date>
    <item>
      <title>removing space</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/removing-space/m-p/216554#M5277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am bringing the data from oracle. one of the character variable has value like&lt;/P&gt;&lt;P&gt;abc 25&lt;/P&gt;&lt;P&gt;spc 26&lt;/P&gt;&lt;P&gt; xy 20 &lt;/P&gt;&lt;P&gt;I have used strip unction to remove the space. But when I compare the data with source value doesn't match. Also tried TRIMN(LEFT()). One more thing I don't want to delete the space between the values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 20:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/removing-space/m-p/216554#M5277</guid>
      <dc:creator>Ishaan</dc:creator>
      <dc:date>2015-06-29T20:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: removing</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/removing-space/m-p/216555#M5278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are using the strip function correctly. I wonder if you've got an encoding issue between Oracle and SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To show you that the strip function is working, here's a code sample you can play with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; length cvar $ 30;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; cvar = 'abc 25'; output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; cvar = ' abc 25'; output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; cvar = 'abc 25 '; output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; cvar = ' abc 25 '; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set have;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; cvar2 = strip(cvar);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc tabulate data=want;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; class cvar2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; table cvar2, n;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 12:31:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/removing-space/m-p/216555#M5278</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2015-06-30T12:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: removing</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/removing-space/m-p/216556#M5279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean that you are pulling data into sas from oracle, then loading back to oracle and comparing your new file to the original?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so I don't think that the new dataset is the problem, it looks like you are using the strip() function correctly.&amp;nbsp; It could be the original data or an issue during the transfer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 12:47:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/removing-space/m-p/216556#M5279</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-06-30T12:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: removing space</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/removing-space/m-p/216557#M5280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seems like a lot for your purpose but I'm sure it'll work.&amp;nbsp; If it's a large dataset I'd put in a where clause too.&amp;nbsp; Scan() will separate by the blank you want to keep and catx() will strip each variable but use the space as a deliminator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;infile cards dsd;&lt;/P&gt;&lt;P&gt;input char $;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;abc 25&lt;/P&gt;&lt;P&gt;spc 26&lt;/P&gt;&lt;P&gt;xy 20&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;cchar = scan(char,1,'');&lt;/P&gt;&lt;P&gt;nchar = scan(char,2,'');&lt;/P&gt;&lt;P&gt;if _N_ =&amp;gt; 1 then do;&lt;/P&gt;&lt;P&gt;new_var = catx(' ',cchar,nchar);&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 19:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/removing-space/m-p/216557#M5280</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-07-02T19:16:52Z</dc:date>
    </item>
  </channel>
</rss>

