<?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: SAS compress function with sysfunc in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SAS-compress-function-with-sysfunc/m-p/664381#M22858</link>
    <description>&lt;P&gt;Sorry! error is&amp;nbsp; -&amp;nbsp; &amp;nbsp;ERROR: Required operator not found in expression: %sysfunc(compress(DX&amp;amp;i ,'.')) in&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%Do i=1 %to 25;&lt;BR /&gt;%if %sysfunc(compress(DX&amp;amp;i ,'.')) in ('DS123') %then output;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jun 2020 16:30:56 GMT</pubDate>
    <dc:creator>SASAna</dc:creator>
    <dc:date>2020-06-23T16:30:56Z</dc:date>
    <item>
      <title>SAS compress function with sysfunc</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-compress-function-with-sysfunc/m-p/664380#M22857</link>
      <description>&lt;P&gt;Hello SAS users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need help with compressing the dots in the macro variables of DX1 to DX50. and i am getting the below error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;code&amp;nbsp; -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%Do i=1 %to 50;&lt;/P&gt;
&lt;P&gt;%if %sysfunc(compress(DX&amp;amp;i) ,'.')) in ( ' DS123')&amp;nbsp; %then output;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: Format name '.' not found or the width and/or decimal specified for the format used are out of range.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Ana&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 16:21:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-compress-function-with-sysfunc/m-p/664380#M22857</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2020-06-23T16:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS compress function with sysfunc</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-compress-function-with-sysfunc/m-p/664381#M22858</link>
      <description>&lt;P&gt;Sorry! error is&amp;nbsp; -&amp;nbsp; &amp;nbsp;ERROR: Required operator not found in expression: %sysfunc(compress(DX&amp;amp;i ,'.')) in&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%Do i=1 %to 25;&lt;BR /&gt;%if %sysfunc(compress(DX&amp;amp;i ,'.')) in ('DS123') %then output;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 16:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-compress-function-with-sysfunc/m-p/664381#M22858</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2020-06-23T16:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS compress function with sysfunc</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-compress-function-with-sysfunc/m-p/664383#M22859</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/86567"&gt;@SASAna&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello SAS users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need help with compressing the dots in the macro variables of DX1 to DX50. and i am getting the below error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;code&amp;nbsp; -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%Do i=1 %to 50;&lt;/P&gt;
&lt;P&gt;%if %sysfunc(compress(DX&amp;amp;i) ,'.')) in ( ' DS123')&amp;nbsp; %then output;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: Format name '.' not found or the width and/or decimal specified for the format used are out of range.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Ana&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You need to post more of the log, make sure to use the Insert Code button in the menu bar to get a pop-up window to paste the text so that the formatting is preserved.&lt;/P&gt;
&lt;P&gt;Also explain what you think that code is doing.&amp;nbsp; It looks to me like the condition in your %IF statement can never be true.&amp;nbsp; You are testing for a value that includes single quote character, but the value of &amp;amp;I would never include single quotes and even if it did you asked COMPRESS() to removed the single quotes.&amp;nbsp; Perhaps you wanted to generate an actual IF statement instead?&amp;nbsp; Then the quotes are needed for the SAS compiler to tell the difference between a variable name like DX1 and the a constant string like 'DS123'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 16:33:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-compress-function-with-sysfunc/m-p/664383#M22859</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-06-23T16:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAS compress function with sysfunc</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-compress-function-with-sysfunc/m-p/664384#M22860</link>
      <description>&lt;P&gt;That's what you get when you try to do data processing in the macro language. That many macro variables is often a sign of a not well designed issue.&lt;/P&gt;
&lt;P&gt;And the macro language treats literal characters a bit differently than the data step and quotes are often inappropriate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are "compressing" the literal value DX1 for instance. So there is no "space"&amp;nbsp; or "." to begin with.&lt;/P&gt;
&lt;P&gt;Is DX&amp;amp;i a macro variable? or a data set variable?&lt;/P&gt;
&lt;P&gt;You should show a bit more of what you are attempting for code. Since the macro language doesn't recognize "output" I strongly suspect you are mixing macro language and data step incorrectly.&lt;/P&gt;
&lt;P&gt;If you want to go over a bunch of DATA SET variables named DX1, DX2 etc then you likely want something more like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;array vars DX1 - DX50;&lt;/P&gt;
&lt;P&gt;do i= 1 to dim(vars);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; if compress(vars[i],'.') in ('DS123') then output;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 16:24:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-compress-function-with-sysfunc/m-p/664384#M22860</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-25T16:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: SAS compress function with sysfunc</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-compress-function-with-sysfunc/m-p/664393#M22861</link>
      <description>Macro code with diagnosis codes make me suspect you should use arrays instead of macros. Is that an option here? It simplifies your code significantly.</description>
      <pubDate>Tue, 23 Jun 2020 17:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-compress-function-with-sysfunc/m-p/664393#M22861</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-23T17:09:28Z</dc:date>
    </item>
  </channel>
</rss>

