<?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: Invalid date/time constant in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Invalid-date-time-constant/m-p/723876#M224712</link>
    <description>&lt;P&gt;What it says. The string&lt;/P&gt;
&lt;PRE&gt;stdft.&lt;/PRE&gt;
&lt;P&gt;is not a valid date in DATE9. format (which is needed for a date literal).&lt;/P&gt;</description>
    <pubDate>Fri, 05 Mar 2021 14:25:35 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-03-05T14:25:35Z</dc:date>
    <item>
      <title>Invalid date/time constant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-date-time-constant/m-p/723875#M224711</link>
      <description>&lt;P&gt;Hello all, I am working with the code below and I keep getting the error.&amp;nbsp;&lt;SPAN&gt;ERROR: Invalid date/time/datetime constant "stdft."d. I have checked my&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;formats and they are all the same and I just can't seem to figure out what is causing the error?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data dates;&lt;BR /&gt; infile datalines delimiter = ',';&lt;BR /&gt; input ID $ DATE:anydtdte11. COND STDT:anydtdte11. ENDT:anydtdte11. ;&lt;BR /&gt; format  date stdt endt mmddyy10.;&lt;BR /&gt; datalines;&lt;BR /&gt;1,  05/03/2018, .,    05/03/2017, 05/03/2018&lt;BR /&gt;1,  05/02/2018, .,   05/02/2017, 05/03/2018&lt;BR /&gt;2,  04/26/2018, 1,    04/26/2017, 04/27/2018&lt;BR /&gt;2,  04/18/2018, 1,    04/18/2017, 04/18/2018&lt;BR /&gt;2,  04/10/2018,  1,  04/10/2017, 04/10/2018&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sql; &lt;BR /&gt;      create table want as &lt;BR /&gt;       select distinct *, stdt as STDFT format date9., stdt as ENDTFT format date9.&lt;BR /&gt;       from dates&lt;BR /&gt;      where cond=1 and date between "stdft."d and "endtft."d; &lt;BR /&gt;quit;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Mar 2021 14:20:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-date-time-constant/m-p/723875#M224711</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2021-03-05T14:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid date/time constant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-date-time-constant/m-p/723876#M224712</link>
      <description>&lt;P&gt;What it says. The string&lt;/P&gt;
&lt;PRE&gt;stdft.&lt;/PRE&gt;
&lt;P&gt;is not a valid date in DATE9. format (which is needed for a date literal).&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 14:25:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-date-time-constant/m-p/723876#M224712</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-03-05T14:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid date/time constant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-date-time-constant/m-p/723877#M224713</link>
      <description>&lt;P&gt;Your variables STDT and ENDT are already valid SAS dates. You don't need to put quotes around them and add D as in&amp;nbsp;&lt;FONT face="courier new,courier"&gt;"stdft."d&lt;/FONT&gt;. You can just use STDT and ENDT without modification.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql; 
      create table want as 
       select distinct *
       from dates
      where cond=1 and date &amp;gt;= stdt and date &amp;lt;= endt; 
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 14:39:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-date-time-constant/m-p/723877#M224713</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-03-05T14:39:14Z</dc:date>
    </item>
  </channel>
</rss>

