<?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: ERROR: Numeric expression requires a numeric format. in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-Numeric-expression-requires-a-numeric-format/m-p/460907#M29713</link>
    <description>&lt;P&gt;Remove the extra $ in the format name in the FORMAT= option of your SQL code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You defined a numeric format, but in your SQL code you asked for a character format with a similar name.&amp;nbsp; PROC SQL is complaining because the variable you are trying to attach the format to is numeric, not character.&amp;nbsp; If you attempt to attach a format of the wrong type in a FORMAT statement of a DATA step SAS will auto-correct to using a similarly named format of the&amp;nbsp;appropriate&amp;nbsp;type for the variable.&amp;nbsp; But in a PROC SQL SELECT statement it causes a hard error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 May 2018 03:42:35 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-05-09T03:42:35Z</dc:date>
    <item>
      <title>ERROR: Numeric expression requires a numeric format.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-Numeric-expression-requires-a-numeric-format/m-p/460904#M29711</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to read a numeric variable from a table using PROC SQL but I want the variable which it falls into to be a character variable containing the various formats depending on its value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;proc format;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value&amp;nbsp;price_bands&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "$0-$5,000"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0-5000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "$0-$5,000"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5001-10000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "$5,001-$10,000"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;create table demo_test as&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;select a.*, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b.price as price_band format=$price_bands.&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;from table1 as a&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;left join table2 as b&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;on a.key= b.key&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;quit;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Problem is, I am getting this error:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;ERROR: Numeric expression requires a numeric format.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="Arial"&gt;Any help will be greatly appreciated and Liked.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="Arial"&gt;Kind regards,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="Arial"&gt;Mark&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 03:00:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-Numeric-expression-requires-a-numeric-format/m-p/460904#M29711</guid>
      <dc:creator>markc</dc:creator>
      <dc:date>2018-05-09T03:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Numeric expression requires a numeric format.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-Numeric-expression-requires-a-numeric-format/m-p/460907#M29713</link>
      <description>&lt;P&gt;Remove the extra $ in the format name in the FORMAT= option of your SQL code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You defined a numeric format, but in your SQL code you asked for a character format with a similar name.&amp;nbsp; PROC SQL is complaining because the variable you are trying to attach the format to is numeric, not character.&amp;nbsp; If you attempt to attach a format of the wrong type in a FORMAT statement of a DATA step SAS will auto-correct to using a similarly named format of the&amp;nbsp;appropriate&amp;nbsp;type for the variable.&amp;nbsp; But in a PROC SQL SELECT statement it causes a hard error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 03:42:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/ERROR-Numeric-expression-requires-a-numeric-format/m-p/460907#M29713</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-05-09T03:42:35Z</dc:date>
    </item>
  </channel>
</rss>

