<?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 func has too many arguments in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Compress-func-has-too-many-arguments/m-p/477780#M123120</link>
    <description>&lt;P&gt;The 2nd argument of compress is a string contains the&amp;nbsp;delimiters or characters to ignore.&lt;/P&gt;
&lt;P&gt;There is a 3rd argument with special means. In your case "kd" means &lt;STRONG&gt;k&lt;/STRONG&gt;eep &lt;STRONG&gt;d&lt;/STRONG&gt;igits only:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;a1 = compress(abc, , 'kd');&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You better look at the documentation.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jul 2018 05:45:12 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2018-07-13T05:45:12Z</dc:date>
    <item>
      <title>Compress func has too many arguments</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compress-func-has-too-many-arguments/m-p/477778#M123118</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input abc $;
cards;
1.0 MG
0.25#
*1
2.5 UG
run;


data want;
set have;
a1 = compress(abc,'#*','s','a');
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I need only the numeric value. while using the compress func an ERROR occurred:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The COMPRESS function call has too many arguments.&lt;/P&gt;&lt;P&gt;Please suggest me any methods to solve.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 06:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compress-func-has-too-many-arguments/m-p/477778#M123118</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2018-07-13T06:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Compress func has too many arguments</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compress-func-has-too-many-arguments/m-p/477780#M123120</link>
      <description>&lt;P&gt;The 2nd argument of compress is a string contains the&amp;nbsp;delimiters or characters to ignore.&lt;/P&gt;
&lt;P&gt;There is a 3rd argument with special means. In your case "kd" means &lt;STRONG&gt;k&lt;/STRONG&gt;eep &lt;STRONG&gt;d&lt;/STRONG&gt;igits only:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;a1 = compress(abc, , 'kd');&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You better look at the documentation.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 05:45:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compress-func-has-too-many-arguments/m-p/477780#M123120</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-07-13T05:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Compress func has too many arguments</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compress-func-has-too-many-arguments/m-p/477784#M123121</link>
      <description>&lt;P&gt;If i use 'kd' in compress then it delete '.'&amp;nbsp;&lt;SPAN&gt;punctuation&lt;/SPAN&gt; in (1.5, 2.5, 1.0) so the value should like (15 , 25, 10)&lt;/P&gt;&lt;P&gt;I need value in decimal as same as in my dataset.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 05:53:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compress-func-has-too-many-arguments/m-p/477784#M123121</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2018-07-13T05:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Compress func has too many arguments</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compress-func-has-too-many-arguments/m-p/477795#M123125</link>
      <description>&lt;P&gt;READ THE DOCUMENTATION!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the "modifier" part:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;k or K&amp;nbsp;&amp;nbsp; keeps the characters in the list instead of removing them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you want to keep digits and dots, just use a list of all digits and the dot as second parameter, and k as the third.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input abc $;
cards;
1.0 MG
0.25#
*1
2.5 UG
;
run;

data want;
set have;
a1 = compress(abc,'0123456789.','k');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or use a combination of parameters:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
a1 = compress(abc,'.','kd');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 06:34:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compress-func-has-too-many-arguments/m-p/477795#M123125</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-13T06:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Compress func has too many arguments</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compress-func-has-too-many-arguments/m-p/477800#M123127</link>
      <description>&lt;P&gt;Thank u so much!&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 07:10:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compress-func-has-too-many-arguments/m-p/477800#M123127</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2018-07-13T07:10:40Z</dc:date>
    </item>
  </channel>
</rss>

