<?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: The COMPRESS function call has too many arguments. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/The-COMPRESS-function-call-has-too-many-arguments/m-p/527658#M143905</link>
    <description>&lt;P&gt;That worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; but while using this resolved value in my code, i am not getting the results although it shows it's resolving fine. Here's what i am getting in the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where&lt;BR /&gt;/* and cov.pol_nbr in('0189416','189416','00189416','000189416')*/&lt;/P&gt;&lt;P&gt;and (cov.pol_nbr in&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable POL_NBR1 resolves to '0189416','189416','00189416','000189416'&lt;BR /&gt;119 ! (&amp;amp;POL_NBR1.))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when i am including the above commented piece of code, I am able to get the results.&lt;/P&gt;&lt;P&gt;Why is it so ?&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jan 2019 08:39:09 GMT</pubDate>
    <dc:creator>Abhinav26</dc:creator>
    <dc:date>2019-01-16T08:39:09Z</dc:date>
    <item>
      <title>The COMPRESS function call has too many arguments.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-COMPRESS-function-call-has-too-many-arguments/m-p/527646#M143899</link>
      <description>&lt;P&gt;Getting below error, need a way in order to successfully compress spaces from the string:&amp;nbsp;&lt;SPAN&gt;'0189416','189416','00189416','000189416'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;call symput ('POL_NBR1',compress(&amp;amp;POL_NBR.,'0123456789'));&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable POL_NBR resolves to '0189416','189416','00189416','000189416'&lt;BR /&gt;________&lt;BR /&gt;72&lt;BR /&gt;ERROR 72-185: The COMPRESS function call has too many arguments.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 07:38:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-COMPRESS-function-call-has-too-many-arguments/m-p/527646#M143899</guid>
      <dc:creator>Abhinav26</dc:creator>
      <dc:date>2019-01-16T07:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: The COMPRESS function call has too many arguments.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-COMPRESS-function-call-has-too-many-arguments/m-p/527650#M143901</link>
      <description>&lt;P&gt;When the macro variable is resolved, the following statement is handed to the SAS interpreter:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call symput ('POL_NBR1',compress('0189416','189416','00189416','000189416','0123456789'));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can see that you have 5 arguments for compress(), which only expects 3 arguments at most.&lt;/P&gt;
&lt;P&gt;You can enclose your macr variable in double quotes:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let pol_nbr='0189416','189416','00189416','000189416';

data _null_;
call symput ('POL_NBR1',compress("&amp;amp;POL_NBR.",'0123456789'));
run;

%put pol_nbr1=&amp;amp;pol_nbr1.;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which leaves you with a sequence of empty strings:&lt;/P&gt;
&lt;PRE&gt;43         %put pol_nbr1=&amp;amp;pol_nbr1.;
pol_nbr1='','','',''
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 07:49:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-COMPRESS-function-call-has-too-many-arguments/m-p/527650#M143901</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-16T07:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: The COMPRESS function call has too many arguments.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-COMPRESS-function-call-has-too-many-arguments/m-p/527658#M143905</link>
      <description>&lt;P&gt;That worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; but while using this resolved value in my code, i am not getting the results although it shows it's resolving fine. Here's what i am getting in the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where&lt;BR /&gt;/* and cov.pol_nbr in('0189416','189416','00189416','000189416')*/&lt;/P&gt;&lt;P&gt;and (cov.pol_nbr in&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable POL_NBR1 resolves to '0189416','189416','00189416','000189416'&lt;BR /&gt;119 ! (&amp;amp;POL_NBR1.))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when i am including the above commented piece of code, I am able to get the results.&lt;/P&gt;&lt;P&gt;Why is it so ?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 08:39:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-COMPRESS-function-call-has-too-many-arguments/m-p/527658#M143905</guid>
      <dc:creator>Abhinav26</dc:creator>
      <dc:date>2019-01-16T08:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: The COMPRESS function call has too many arguments.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-COMPRESS-function-call-has-too-many-arguments/m-p/527661#M143907</link>
      <description>&lt;P&gt;Please post the &lt;EM&gt;whole&lt;/EM&gt; log of the step that gives you issues. Use the {i} button for posting logs, to prevent any reformatting or character substitution by the forum software.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 09:10:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-COMPRESS-function-call-has-too-many-arguments/m-p/527661#M143907</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-16T09:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: The COMPRESS function call has too many arguments.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/The-COMPRESS-function-call-has-too-many-arguments/m-p/527695#M143920</link>
      <description>&lt;P&gt;On the surface of things, it looks a little odd that you want to remove spaces from a string that doesn't contain any space.&amp;nbsp; But assuming your description of the problem is correct, this statement is obviously not working:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;call symput ('POL_NBR1',compress(&amp;amp;POL_NBR.,'0123456789'));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The good news:&amp;nbsp; the solution is even simpler:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;call symput ('POL_NBR1',compress("&amp;amp;POL_NBR."'));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;With no additional arguments, COMPRESS removes all spaces.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 13:00:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/The-COMPRESS-function-call-has-too-many-arguments/m-p/527695#M143920</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-01-16T13:00:59Z</dc:date>
    </item>
  </channel>
</rss>

