<?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 concatenate string and declare as date constant in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-concatenate-string-and-declare-as-date-constant/m-p/388418#M25041</link>
    <description>&lt;P&gt;Use the input() function to convert the string to a date:&lt;/P&gt;
&lt;PRE&gt;datepart(exit_date) &amp;gt;= input('15Aug' || PUT(YEAR(Date()-181), 4.),date9.)&lt;/PRE&gt;
&lt;P&gt;Or use the intnx() function to do date calculations:&lt;/P&gt;
&lt;PRE&gt;datepart(exit_date) &amp;gt;= intnx('year','15Aug2017'd,-181,'s');&lt;/PRE&gt;</description>
    <pubDate>Wed, 16 Aug 2017 12:11:02 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-08-16T12:11:02Z</dc:date>
    <item>
      <title>How to concatenate string and declare as date constant</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-concatenate-string-and-declare-as-date-constant/m-p/388415#M25040</link>
      <description>&lt;P&gt;Is this possible to do in Enterprise Guide filter? &amp;nbsp; I usually do a date compare in a filter like this that works fine:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;datepart(exit_date) &amp;gt;= '15Aug2017'd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I would like the to set it up so the year is dynamic, something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'15Aug' || PUT(YEAR(Date()-181), 4.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code produces the correct character format I want 15Aug2017, but I can't just put a 'd' at the end to assign it as date constant for comparison. &amp;nbsp; Any suggestions would be much appreciated. &amp;nbsp;Thanks, Kenny.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EG 6.1&lt;/P&gt;&lt;P&gt;SAS 9.4&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 12:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-concatenate-string-and-declare-as-date-constant/m-p/388415#M25040</guid>
      <dc:creator>kgflynn</dc:creator>
      <dc:date>2017-08-16T12:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to concatenate string and declare as date constant</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-concatenate-string-and-declare-as-date-constant/m-p/388418#M25041</link>
      <description>&lt;P&gt;Use the input() function to convert the string to a date:&lt;/P&gt;
&lt;PRE&gt;datepart(exit_date) &amp;gt;= input('15Aug' || PUT(YEAR(Date()-181), 4.),date9.)&lt;/PRE&gt;
&lt;P&gt;Or use the intnx() function to do date calculations:&lt;/P&gt;
&lt;PRE&gt;datepart(exit_date) &amp;gt;= intnx('year','15Aug2017'd,-181,'s');&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Aug 2017 12:11:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-concatenate-string-and-declare-as-date-constant/m-p/388418#M25041</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-08-16T12:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to concatenate string and declare as date constant</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-concatenate-string-and-declare-as-date-constant/m-p/388445#M25042</link>
      <description>&lt;P&gt;Thanks! &amp;nbsp;That works perfectly.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2017 13:25:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-concatenate-string-and-declare-as-date-constant/m-p/388445#M25042</guid>
      <dc:creator>kgflynn</dc:creator>
      <dc:date>2017-08-16T13:25:46Z</dc:date>
    </item>
  </channel>
</rss>

