<?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 WARNING: In a call to the COMPRESS function or routine, the modifier &amp;quot;,&amp;quot; not  valid. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/WARNING-In-a-call-to-the-COMPRESS-function-or-routine-the/m-p/521185#M141394</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I've imported a csv with dollar values that have $ and commas (e.g. $1,000). This imports as a character variable in SAS 9.4 (which is what I'm using). I'm using a data step and COMPRESS to try to eliminate the commas and $ so I can&amp;nbsp;then convert this to a numeric field.&amp;nbsp; Here's the gist of what I have&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data file_name;set file_name;&lt;/P&gt;
&lt;P&gt;newvar=compress(oldvar,'$',',');&lt;/P&gt;
&lt;P&gt;run; [then in a subsequent data step I convert it to numeric)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This eliminates the $, but the commas remain (i.e. it would now read '1,000'). I also get the following warning:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WARNING: In a call to the COMPRESS function or routine, the modifier "," not&lt;BR /&gt; valid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no possible way I am the only SAS user with this problem, but I can't seem to find a solution anywhere. What am I doing wrong? Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Thu, 13 Dec 2018 16:31:02 GMT</pubDate>
    <dc:creator>SSG</dc:creator>
    <dc:date>2018-12-13T16:31:02Z</dc:date>
    <item>
      <title>WARNING: In a call to the COMPRESS function or routine, the modifier "," not  valid.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-In-a-call-to-the-COMPRESS-function-or-routine-the/m-p/521185#M141394</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I've imported a csv with dollar values that have $ and commas (e.g. $1,000). This imports as a character variable in SAS 9.4 (which is what I'm using). I'm using a data step and COMPRESS to try to eliminate the commas and $ so I can&amp;nbsp;then convert this to a numeric field.&amp;nbsp; Here's the gist of what I have&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data file_name;set file_name;&lt;/P&gt;
&lt;P&gt;newvar=compress(oldvar,'$',',');&lt;/P&gt;
&lt;P&gt;run; [then in a subsequent data step I convert it to numeric)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This eliminates the $, but the commas remain (i.e. it would now read '1,000'). I also get the following warning:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WARNING: In a call to the COMPRESS function or routine, the modifier "," not&lt;BR /&gt; valid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no possible way I am the only SAS user with this problem, but I can't seem to find a solution anywhere. What am I doing wrong? Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 16:31:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-In-a-call-to-the-COMPRESS-function-or-routine-the/m-p/521185#M141394</guid>
      <dc:creator>SSG</dc:creator>
      <dc:date>2018-12-13T16:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: In a call to the COMPRESS function or routine, the modifier "," not  valid.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-In-a-call-to-the-COMPRESS-function-or-routine-the/m-p/521187#M141395</link>
      <description>&lt;P&gt;If you are wondering why nobody else has posted the question, it's because there's an easier way to solve the problem.&amp;nbsp; You don't need COMPRESS at all.&amp;nbsp; In a DATA step, you could use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;newvar = input(oldvar, dollar16.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It will read the numerics, and ignore the commas and dollar signs automatically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But to answer your question, you would need to include the list of characters to remove in a single string:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;newvar=compress(oldvar,'$,');&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 16:39:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-In-a-call-to-the-COMPRESS-function-or-routine-the/m-p/521187#M141395</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-12-13T16:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: In a call to the COMPRESS function or routine, the modifier "," not  valid.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-In-a-call-to-the-COMPRESS-function-or-routine-the/m-p/521188#M141396</link>
      <description>&lt;P&gt;You put both characters in the second parameter. &lt;BR /&gt;&lt;BR /&gt;newvar = compress(oldvar, '$,');&lt;BR /&gt;&lt;BR /&gt;The third parameter is modifiers, please read the documentation. For example putting 'a' as the third parameter would remove all alphabetic variables. I think you could also modify your call to be:&lt;BR /&gt;&lt;BR /&gt;newVar = compress(oldvar, , 'kn');&lt;BR /&gt;which would mean keep all digits, underscores.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n0fcshr0ir3h73n1b845c4aq58hz.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n0fcshr0ir3h73n1b845c4aq58hz.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4077"&gt;@SSG&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I've imported a csv with dollar values that have $ and commas (e.g. $1,000). This imports as a character variable in SAS 9.4 (which is what I'm using). I'm using a data step and COMPRESS to try to eliminate the commas and $ so I can&amp;nbsp;then convert this to a numeric field.&amp;nbsp; Here's the gist of what I have&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data file_name;set file_name;&lt;/P&gt;
&lt;P&gt;newvar=compress(oldvar,'$',',');&lt;/P&gt;
&lt;P&gt;run; [then in a subsequent data step I convert it to numeric)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This eliminates the $, but the commas remain (i.e. it would now read '1,000'). I also get the following warning:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WARNING: In a call to the COMPRESS function or routine, the modifier "," not&lt;BR /&gt; valid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no possible way I am the only SAS user with this problem, but I can't seem to find a solution anywhere. What am I doing wrong? Thanks in advance!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 16:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-In-a-call-to-the-COMPRESS-function-or-routine-the/m-p/521188#M141396</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-13T16:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: WARNING: In a call to the COMPRESS function or routine, the modifier "," not  valid.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WARNING-In-a-call-to-the-COMPRESS-function-or-routine-the/m-p/521221#M141399</link>
      <description>&lt;P&gt;Well, I'd tried dollar8. before I went down this road and I got an error indicating dollar8. was an invalid format; but for some reason dollar16. worked.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 17:46:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WARNING-In-a-call-to-the-COMPRESS-function-or-routine-the/m-p/521221#M141399</guid>
      <dc:creator>SSG</dc:creator>
      <dc:date>2018-12-13T17:46:18Z</dc:date>
    </item>
  </channel>
</rss>

