<?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: How to convert numeric value without format in Macro variable to actual date? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-value-without-format-in-Macro-variable-to/m-p/821090#M324153</link>
    <description>&lt;P&gt;If the variable batchdate is a SAS date value, then the comparison is very simple:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where batchdate &amp;lt;= &amp;amp;testdt.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 30 Jun 2022 09:19:12 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-06-30T09:19:12Z</dc:date>
    <item>
      <title>How to convert numeric value without format in Macro variable to actual date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-value-without-format-in-Macro-variable-to/m-p/821071#M324148</link>
      <description>&lt;P&gt;How to convert numeric value without format in Macro variable to actual date?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a macro variable that stores value of "&amp;nbsp; &amp;nbsp;21619".&lt;/P&gt;&lt;P&gt;However, as we know, it has leading space and that it is a character.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;script as follows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data a;

testdt='&amp;nbsp; &amp;nbsp;21619';

run;



proc sql noprint;

select testdt into:testdt

from a;

quit;

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use &amp;amp;testdt. to do query in another table within the same macro but it just keeps giving me errors.&lt;/P&gt;&lt;P&gt;my script as follows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC SQL;
CREATE TABLE usa AS
SELECT *
FROM temp.car
where batchdate &amp;lt;= %sysfunc(put("&amp;amp;testdt.",date9.));

quit;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I might have overlooked some of the important steps in converting it but what is wrong here?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 07:41:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-value-without-format-in-Macro-variable-to/m-p/821071#M324148</guid>
      <dc:creator>StickyRoll</dc:creator>
      <dc:date>2022-06-30T07:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert numeric value without format in Macro variable to actual date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-value-without-format-in-Macro-variable-to/m-p/821090#M324153</link>
      <description>&lt;P&gt;If the variable batchdate is a SAS date value, then the comparison is very simple:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where batchdate &amp;lt;= &amp;amp;testdt.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jun 2022 09:19:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-numeric-value-without-format-in-Macro-variable-to/m-p/821090#M324153</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-06-30T09:19:12Z</dc:date>
    </item>
  </channel>
</rss>

