<?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: Turn macro variable into a number in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Turn-macro-variable-into-a-number/m-p/296937#M62303</link>
    <description>It did work, thanks. I hadn't thought of trying the most simple thing.</description>
    <pubDate>Wed, 07 Sep 2016 11:45:13 GMT</pubDate>
    <dc:creator>sleretrano</dc:creator>
    <dc:date>2016-09-07T11:45:13Z</dc:date>
    <item>
      <title>Turn macro variable into a number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Turn-macro-variable-into-a-number/m-p/296935#M62301</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use a macro variable in a WHERE condition in a PROC SQL, but I need to to be evaluated as a number because Var3 below is numeric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let horizon=201606:

PROC SQL;
CREATE TABLE CTX AS
SELECT Variables
FROM Table1 T1
LEFT JOIN Table2 T2 ON (T1.Var1=T2.Var1)
WHERE T2.Var3 le %EVAL(put(&amp;amp;Horizon.,6.));
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Courier New" size="3"&gt;How can I go about this?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2016 11:28:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Turn-macro-variable-into-a-number/m-p/296935#M62301</guid>
      <dc:creator>sleretrano</dc:creator>
      <dc:date>2016-09-07T11:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Turn macro variable into a number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Turn-macro-variable-into-a-number/m-p/296936#M62302</link>
      <description>&lt;P&gt;Macro variables are text not really char/numeric. They do literal text replacement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following will work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Where t2.var3 LE &amp;amp;horizon;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If it doesn't work you may have a type mismatch and most likely var3 is numeric with a date format?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2016 11:35:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Turn-macro-variable-into-a-number/m-p/296936#M62302</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-07T11:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Turn macro variable into a number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Turn-macro-variable-into-a-number/m-p/296937#M62303</link>
      <description>It did work, thanks. I hadn't thought of trying the most simple thing.</description>
      <pubDate>Wed, 07 Sep 2016 11:45:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Turn-macro-variable-into-a-number/m-p/296937#M62303</guid>
      <dc:creator>sleretrano</dc:creator>
      <dc:date>2016-09-07T11:45:13Z</dc:date>
    </item>
  </channel>
</rss>

