<?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 Hold the spaces while compress function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Hold-the-spaces-while-compress-function/m-p/735914#M229266</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm wondering how to hold the spaces while using the compress function. The values of my variable is X='TYPE 1 INDEX 2'.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I use compress(X||' '||'P3') I have '&lt;STRONG&gt;TYPE1INDEX2&lt;/STRONG&gt; P3', I would like to have&amp;nbsp;TYPE 1 INDEX 2 P3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is some option for compress function please or, in this case, the STRIP function is better ?&lt;/P&gt;
&lt;P&gt;Thank you for helping !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Apr 2021 13:51:52 GMT</pubDate>
    <dc:creator>SASdevAnneMarie</dc:creator>
    <dc:date>2021-04-21T13:51:52Z</dc:date>
    <item>
      <title>Hold the spaces while compress function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hold-the-spaces-while-compress-function/m-p/735914#M229266</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm wondering how to hold the spaces while using the compress function. The values of my variable is X='TYPE 1 INDEX 2'.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I use compress(X||' '||'P3') I have '&lt;STRONG&gt;TYPE1INDEX2&lt;/STRONG&gt; P3', I would like to have&amp;nbsp;TYPE 1 INDEX 2 P3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is some option for compress function please or, in this case, the STRIP function is better ?&lt;/P&gt;
&lt;P&gt;Thank you for helping !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 13:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hold-the-spaces-while-compress-function/m-p/735914#M229266</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2021-04-21T13:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Hold the spaces while compress function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hold-the-spaces-while-compress-function/m-p/735932#M229273</link>
      <description>&lt;P&gt;I can't tell if this is what you want, but it seemed like a variant that's acceptable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
x = "TYPE 1 INDEX 2";
y = prxchange("s/(?&amp;lt;!\d)\s//", -1, x);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs x y 
1 TYPE 1 INDEX 2 TYPE1 INDEX2 
&lt;/PRE&gt;
&lt;P&gt;If you're unfamiliar with regular expressions, these resources will be helpful.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n0r8h2fa8djqf1n1cnenrvm573br.htm" target="_self"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n0r8h2fa8djqf1n1cnenrvm573br.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/rnd/base/datastep/perl_regexp/regexp-tip-sheet.pdf" target="_self"&gt;https://support.sas.com/rnd/base/datastep/perl_regexp/regexp-tip-sheet.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 12:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hold-the-spaces-while-compress-function/m-p/735932#M229273</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2021-04-21T12:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Hold the spaces while compress function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hold-the-spaces-while-compress-function/m-p/735942#M229275</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm wondering how to hold the spaces while using the compress function. The values of my variable is X='TYPE 1 INDEX 2'.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I use compress(X) I have 'TYPE1INDEX2'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for helping !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;But, why are you calling compress?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 12:53:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hold-the-spaces-while-compress-function/m-p/735942#M229275</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-04-21T12:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Hold the spaces while compress function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hold-the-spaces-while-compress-function/m-p/735946#M229276</link>
      <description>&lt;P&gt;Can you share what are you expecting the output to look like? Compress might not be the right choice of function here based on what you are trying to do.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 13:03:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hold-the-spaces-while-compress-function/m-p/735946#M229276</guid>
      <dc:creator>AnujaNagpal</dc:creator>
      <dc:date>2021-04-21T13:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Hold the spaces while compress function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hold-the-spaces-while-compress-function/m-p/735956#M229277</link>
      <description>It is  depended on what you need after COMPRESS().&lt;BR /&gt;&lt;BR /&gt;data have;&lt;BR /&gt;x = "TYPE 1 INDEX 2";&lt;BR /&gt;y = compress(x,' ','kw');&lt;BR /&gt;run;</description>
      <pubDate>Wed, 21 Apr 2021 13:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hold-the-spaces-while-compress-function/m-p/735956#M229277</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-04-21T13:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Hold the spaces while compress function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hold-the-spaces-while-compress-function/m-p/736042#M229297</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You may be looking for this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;compbl(X||' '||'P3')&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Apr 2021 15:47:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hold-the-spaces-while-compress-function/m-p/736042#M229297</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2021-04-21T15:47:58Z</dc:date>
    </item>
  </channel>
</rss>

