<?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 Function using a decimal with range in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319210#M70044</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
original = "&amp;lt;= 0.3";
compressed = compress(original,'&amp;lt;=');
run;

proc print data=test;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;works.&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;PRE&gt;Obs    original    compressed

 1      &amp;lt;= 0.3        0.3    
&lt;/PRE&gt;</description>
    <pubDate>Thu, 15 Dec 2016 10:13:31 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-12-15T10:13:31Z</dc:date>
    <item>
      <title>Compress Function using a decimal with range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319208#M70043</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to compress a data like "&amp;lt;= 0.3" to "0.3", but COMPRESS FUNCTION seems that just can compress ALL &lt;SPAN&gt;punctuation marks at one time...So, i&lt;/SPAN&gt;s there any better way to compress only "&amp;lt;= " and keep the decimal?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this is just one example of my data. I need a resolution for all cases like this. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Original &amp;nbsp; &amp;nbsp;Compressed&lt;/P&gt;&lt;P&gt;&amp;lt;= 0.3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.3&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0.58 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.58&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;gt; 1.2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.2&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;45 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;45&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 10:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319208#M70043</guid>
      <dc:creator>JohnChen_TW</dc:creator>
      <dc:date>2016-12-15T10:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Compress Function using a decimal with range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319210#M70044</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
original = "&amp;lt;= 0.3";
compressed = compress(original,'&amp;lt;=');
run;

proc print data=test;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;works.&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;PRE&gt;Obs    original    compressed

 1      &amp;lt;= 0.3        0.3    
&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Dec 2016 10:13:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319210#M70044</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-12-15T10:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Compress Function using a decimal with range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319211#M70045</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/118383"&gt;@JohnChen_TW&lt;/a&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use&amp;nbsp;this line :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;compressed &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;compress&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;original&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'&amp;lt;='&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="token punctuation"&gt;this will remove &lt;STRONG&gt;&amp;lt;= &lt;/STRONG&gt;combination from the variaable;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="token punctuation"&gt;But,&amp;nbsp;on the third line you provided another special character in sample data,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="token punctuation"&gt;so below code will not compress this special character;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="token punctuation"&gt;so in this case you can use this code:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
set test;
compressed=compress(original,'&amp;lt;');
compressed=compress(original,'=');
compressed=compress(original,'&amp;gt;');
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="token punctuation"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="token punctuation"&gt;it will remove all the possible combination like: &lt;STRONG&gt;&amp;lt;=&lt;/STRONG&gt;,&lt;STRONG&gt; &amp;lt;&lt;/STRONG&gt;,&lt;STRONG&gt; =&lt;/STRONG&gt;,&lt;STRONG&gt; &amp;gt;&lt;/STRONG&gt;,&lt;STRONG&gt; =&amp;gt; &lt;/STRONG&gt;from the variable&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 10:24:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319211#M70045</guid>
      <dc:creator>Kalind_Patel</dc:creator>
      <dc:date>2016-12-15T10:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Compress Function using a decimal with range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319221#M70048</link>
      <description>&lt;P&gt;Well, its likely that you have other maths symbols, so maybe reverse the thinking, the below "k"eeps, only "d"igits and the decimal:&lt;/P&gt;
&lt;PRE&gt;data test;
  original = "&amp;lt;= 0.3";
  compressed = compress(original,'.','kd');
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Dec 2016 10:39:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319221#M70048</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-12-15T10:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: Compress Function using a decimal with range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319430#M70155</link>
      <description>Well, this will resolve only the first line of data. Thank you.</description>
      <pubDate>Fri, 16 Dec 2016 02:26:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319430#M70155</guid>
      <dc:creator>JohnChen_TW</dc:creator>
      <dc:date>2016-12-16T02:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Compress Function using a decimal with range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319431#M70156</link>
      <description>Kalind_Patel, thanks for your suggestion.&lt;BR /&gt;Well, maybe my question is unclear. The point is that I need to keep only "0.1", "1.5", ...and so on.&lt;BR /&gt;Thank you.</description>
      <pubDate>Fri, 16 Dec 2016 02:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319431#M70156</guid>
      <dc:creator>JohnChen_TW</dc:creator>
      <dc:date>2016-12-16T02:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Compress Function using a decimal with range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319432#M70157</link>
      <description>Hi RW9,&lt;BR /&gt;&lt;BR /&gt;Thanks for your answer! It resolved my question. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Fri, 16 Dec 2016 02:37:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compress-Function-using-a-decimal-with-range/m-p/319432#M70157</guid>
      <dc:creator>JohnChen_TW</dc:creator>
      <dc:date>2016-12-16T02:37:02Z</dc:date>
    </item>
  </channel>
</rss>

