<?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: Compress not working as expected in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Compress-not-working-as-expected/m-p/591368#M15203</link>
    <description>&lt;P&gt;You're likely dealing with LF which you might get from importing data from Excel. I guess what you need is replacing such non-printable characters with a blank rather than just removing them.&lt;/P&gt;
&lt;P&gt;Below using RegEx as the "big stick" to address any potential whitespace characters at once. Consecutive whitespace characters will be replaced with a single blank.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  Raw_Source='Intestinal'||'0A'x||'Disorder';
  Raw_Source2=prxchange('s/\s+/ /oi',-1,trim(raw_source));
  output;
  stop;
run;
proc print data=have;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Sep 2019 02:59:27 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2019-09-25T02:59:27Z</dc:date>
    <item>
      <title>Compress not working as expected</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Compress-not-working-as-expected/m-p/591339#M15200</link>
      <description>&lt;P&gt;There is a sas dataset and a variable Raw_Source has value as shown below( It is one value but the disorder has come to next line)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Raw_Source&lt;/P&gt;&lt;P&gt;Intestinal&lt;/P&gt;&lt;P&gt;Disorder&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used compress(raw_source,'kw') to get the result as "Intestinal Disorder". but instead the result comes as "IntestinalDisorder".&lt;/P&gt;&lt;P&gt;How to fix this issue? Any help is greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 00:47:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Compress-not-working-as-expected/m-p/591339#M15200</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2019-09-25T00:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Compress not working as expected</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Compress-not-working-as-expected/m-p/591351#M15202</link>
      <description>&lt;P&gt;Are you confusing the COMPRESS and COMPBL functions? COMPRESS removes all spaces between words while COMPBL leaves single spaces between words:&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p1si0i16bcqti7n1jxxxe1hstunq.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p1si0i16bcqti7n1jxxxe1hstunq.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 02:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Compress-not-working-as-expected/m-p/591351#M15202</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-09-25T02:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Compress not working as expected</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Compress-not-working-as-expected/m-p/591368#M15203</link>
      <description>&lt;P&gt;You're likely dealing with LF which you might get from importing data from Excel. I guess what you need is replacing such non-printable characters with a blank rather than just removing them.&lt;/P&gt;
&lt;P&gt;Below using RegEx as the "big stick" to address any potential whitespace characters at once. Consecutive whitespace characters will be replaced with a single blank.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  Raw_Source='Intestinal'||'0A'x||'Disorder';
  Raw_Source2=prxchange('s/\s+/ /oi',-1,trim(raw_source));
  output;
  stop;
run;
proc print data=have;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 02:59:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Compress-not-working-as-expected/m-p/591368#M15203</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-09-25T02:59:27Z</dc:date>
    </item>
  </channel>
</rss>

