<?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: Where statement in proc to compare negparen format values, How? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Where-statement-in-proc-to-compare-negparen-format-values-How/m-p/190082#M35853</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are you trying to do?&lt;/P&gt;&lt;P&gt;I'm lost &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Jul 2014 20:51:01 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2014-07-22T20:51:01Z</dc:date>
    <item>
      <title>Where statement in proc to compare negparen format values, How?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-statement-in-proc-to-compare-negparen-format-values-How/m-p/190079#M35850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Hi, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data A is in the format of NegParen16 (comma delimited, negative number&amp;nbsp; in parentheses format),&amp;nbsp; Y is a macro variable with value 6,243,423 get from an observation of X1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following procedure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc univariate data=A noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var X1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output out=B mean=X1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where X1 &amp;lt;= &amp;amp;Y;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Has error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Courier New;"&gt;Syntax error while parsing where clause.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Courier New;"&gt;Basically it has X1 &amp;lt;= 6,243,423. It cannot handle these commas.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: Courier New;"&gt;Q: How do fix it without changing the data format of data A?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 16:23:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-statement-in-proc-to-compare-negparen-format-values-How/m-p/190079#M35850</guid>
      <dc:creator>Macro</dc:creator>
      <dc:date>2014-07-22T16:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Where statement in proc to compare negparen format values, How?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-statement-in-proc-to-compare-negparen-format-values-How/m-p/190080#M35851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Remove the comma's from the macro variable. The where will check the underlying value, the format is only for display.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 16:31:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-statement-in-proc-to-compare-negparen-format-values-How/m-p/190080#M35851</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-07-22T16:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Where statement in proc to compare negparen format values, How?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-statement-in-proc-to-compare-negparen-format-values-How/m-p/190081#M35852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indeed, I used the follwoing to generate 100 macro variables my_xx since data A has 100 variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;&amp;nbsp; select name into :dname separated by ','&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dictionary.columns&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where libname="WORK" and memname="A";&lt;/P&gt;&lt;P&gt;&amp;nbsp; select compress(":"||"my_"||name) into: mdname separated by ','&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from DICTIONARY.COLUMNS&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE LIBNAME="WORK" AND MEMNAME="A";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* How do you modify the following so that my_XX macro variables do not have commas and parentheses?;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; select &amp;amp;dname into &amp;amp;mdname&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from A;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* &amp;amp;mdname (list of variables that play the role of Y above) is the one has comma and parentheses and coused problem;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 20:40:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-statement-in-proc-to-compare-negparen-format-values-How/m-p/190081#M35852</guid>
      <dc:creator>Macro</dc:creator>
      <dc:date>2014-07-22T20:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: Where statement in proc to compare negparen format values, How?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-statement-in-proc-to-compare-negparen-format-values-How/m-p/190082#M35853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are you trying to do?&lt;/P&gt;&lt;P&gt;I'm lost &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 20:51:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-statement-in-proc-to-compare-negparen-format-values-How/m-p/190082#M35853</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-07-22T20:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Where statement in proc to compare negparen format values, How?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-statement-in-proc-to-compare-negparen-format-values-How/m-p/190083#M35854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The COMPRESS function can remove more than blanks.&amp;nbsp; You just have to tell it what to remove, or what to keep.&amp;nbsp; You would do this by adding between ||name and the closing parenthesis.&amp;nbsp; Some examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compress(var)&amp;nbsp; removes blanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compress(var, '( ),')&amp;nbsp; removes parentheses, blanks (because there is a blank between the quoted parentheses), and commas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compress(var,,'kd')&amp;nbsp; keeps digits only and discards the rest of the characters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your problem may be more complex than this because you may need to replace parentheses with a negative sign, rather than just removing them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are we getting closer?&amp;nbsp; Would it make sense to go back to Reeza's original suggestion and change the earlier code that creates the macro variables instead of fixing the problem later?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 21:04:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-statement-in-proc-to-compare-negparen-format-values-How/m-p/190083#M35854</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-07-22T21:04:42Z</dc:date>
    </item>
  </channel>
</rss>

