<?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: Date between statement error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-between-statement-error/m-p/308400#M66180</link>
    <description>&lt;P&gt;If you don't expect years like 19xx in your data then add to your code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;options yearcutoff = 2000;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Oct 2016 23:26:21 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2016-10-31T23:26:21Z</dc:date>
    <item>
      <title>Date between statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-between-statement-error/m-p/308392#M66176</link>
      <description>I have a data step&lt;BR /&gt;Data _null;&lt;BR /&gt;Z=-1;&lt;BR /&gt;Call symputx ('y' ,z);&lt;BR /&gt;Run;&lt;BR /&gt;%put &amp;amp;y;&lt;BR /&gt;Data _null_;&lt;BR /&gt;Length DOWN $10;&lt;BR /&gt;X=weekday (today ()&amp;amp;y);&lt;BR /&gt;If x=1 then DOW = 'Sunday';&lt;BR /&gt;If x=2 then DOW = 'M&lt;BR /&gt;If x =3 then DOW = 'Tuesday';&lt;BR /&gt;&lt;BR /&gt;If x=1 then DOW = 'Wednesday';&lt;BR /&gt;If x=1 then DOW = 'thursday';&lt;BR /&gt;&lt;BR /&gt;If x=1 then DOW = 'friday';&lt;BR /&gt;If x=1 then DOW = 'Saturday ';&lt;BR /&gt;&lt;BR /&gt;Call symput('DOW','DOW');&lt;BR /&gt;Run;&lt;BR /&gt;%put &amp;amp;DOW;&lt;BR /&gt;DATA _NULL_; START_DATE=TODAY ()&amp;amp;Y;&lt;BR /&gt;IF WEEKDAY (START_DATE)=1 THEN START_DATE =START_DATE-1;&lt;BR /&gt;CALL SYMPUT ('DT', " ' "||PUT (START_DATE,date.)||" '");&lt;BR /&gt;Run;&lt;BR /&gt;In my andstatenent and al1.start_time = &amp;amp;dt1.&lt;BR /&gt;&lt;BR /&gt;Error log&lt;BR /&gt;CLI PREPARE ERROR. TERADATA A CHARACTER STRING FAILED TO CONVERSION TO NUMERIC VALUE. The dt1. Resolves to 30oct16&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Oct 2016 22:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-between-statement-error/m-p/308392#M66176</guid>
      <dc:creator>Beto16</dc:creator>
      <dc:date>2016-10-31T22:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Date between statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-between-statement-error/m-p/308394#M66177</link>
      <description>&lt;P&gt;This doesn't make a whole lot of sense. Why multiply the date by -1, that will cause issues down the road. You have multiple checks for day of week 1?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Look at DOWNAME format.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dow=%sysfunc(today(), downame.);
%put &amp;amp;dow.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2. Where is the error being generated from? You've posted a lot of code - what's the actual issue?&lt;/P&gt;
&lt;P&gt;3. I don't see the keyword BETWEEN so not sure what you're referring to here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 22:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-between-statement-error/m-p/308394#M66177</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-31T22:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Date between statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-between-statement-error/m-p/308395#M66178</link>
      <description>&lt;P&gt;If you're trying to increment the date use the INTNX function rather than -1 to make sure it evaluates properly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 22:27:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-between-statement-error/m-p/308395#M66178</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-31T22:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Date between statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-between-statement-error/m-p/308397#M66179</link>
      <description>&lt;P&gt;You have a Teradata error but do no show any connection, so missing some information.&lt;/P&gt;
&lt;P&gt;Also putting quotes into macro variables frequently causes issues and your DT varaible has spaces inside the single quotes which may be even more problematic depending on use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would also suggest use of DATE9. so that you have a 4 digit year just in case year values become an issue. Some other program may assume that 16 is 1916.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 22:46:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-between-statement-error/m-p/308397#M66179</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-31T22:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Date between statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-between-statement-error/m-p/308400#M66180</link>
      <description>&lt;P&gt;If you don't expect years like 19xx in your data then add to your code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;options yearcutoff = 2000;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 23:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-between-statement-error/m-p/308400#M66180</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-10-31T23:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Date between statement error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-between-statement-error/m-p/308488#M66208</link>
      <description>&lt;P&gt;You don't show the actual Teradata call, so a bit guessing here.&lt;/P&gt;
&lt;P&gt;If you are using implicit pass through (using Libname to Teradata), I assume that you need to use a SAS date literal, you can either extend your&amp;nbsp;macro variable, or add it at macro variable resolution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are using explicit pass through, you need a format that Terdata accepts, and chances are that they prefer a ISO date.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 12:35:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-between-statement-error/m-p/308488#M66208</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-11-01T12:35:13Z</dc:date>
    </item>
  </channel>
</rss>

