<?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: filtering by date in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/filtering-by-date/m-p/593931#M15590</link>
    <description>The unformatted value.</description>
    <pubDate>Thu, 03 Oct 2019 21:12:14 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-10-03T21:12:14Z</dc:date>
    <item>
      <title>filtering by date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/filtering-by-date/m-p/593922#M15587</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem filtering a date based on the format new_date monyy5.;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have variables that have that format and I want to pull the data based on the month that they land on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tired to do something like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data X;&lt;BR /&gt;set Y;&lt;BR /&gt;where new_date='SEP19'd;&amp;nbsp;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;keeps telling me that I have an invalid date/time/datetime constant - why is that?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 21:02:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/filtering-by-date/m-p/593922#M15587</guid>
      <dc:creator>sasxii</dc:creator>
      <dc:date>2019-10-03T21:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: filtering by date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/filtering-by-date/m-p/593924#M15588</link>
      <description>&lt;P&gt;Because you need to use the underlying value, not the formatted value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or convert to the formatted value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data X;
set Y;
where put(new_date, monyy5.)='SEP19'; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/289716"&gt;@sasxii&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a problem filtering a date based on the format new_date monyy5.;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have variables that have that format and I want to pull the data based on the month that they land on.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tired to do something like this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data X;&lt;BR /&gt;set Y;&lt;BR /&gt;where new_date='SEP19'd;&amp;nbsp;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;keeps telling me that I have an invalid date/time/datetime constant - why is that?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 21:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/filtering-by-date/m-p/593924#M15588</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-03T21:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: filtering by date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/filtering-by-date/m-p/593928#M15589</link>
      <description>&lt;P&gt;underlying value?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 21:09:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/filtering-by-date/m-p/593928#M15589</guid>
      <dc:creator>sasxii</dc:creator>
      <dc:date>2019-10-03T21:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: filtering by date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/filtering-by-date/m-p/593931#M15590</link>
      <description>The unformatted value.</description>
      <pubDate>Thu, 03 Oct 2019 21:12:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/filtering-by-date/m-p/593931#M15590</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-03T21:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: filtering by date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/filtering-by-date/m-p/593932#M15591</link>
      <description>&lt;P&gt;so I tried using that as well which was a datetime. format - which consisted of&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data X;&lt;BR /&gt;set Y;&lt;BR /&gt;if DATE &amp;gt;= '01SEP19:20:55:00'd and DATE &amp;lt;= '30SEP19:20:55:00'd;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and it doesnt pull up anything, why would that be the case?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 21:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/filtering-by-date/m-p/593932#M15591</guid>
      <dc:creator>sasxii</dc:creator>
      <dc:date>2019-10-03T21:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: filtering by date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/filtering-by-date/m-p/593935#M15592</link>
      <description>You're changing the question on me here. &lt;BR /&gt;&lt;BR /&gt;You initially stated you had a date variable with monyy format. &lt;BR /&gt;Now you have a datetime?&lt;BR /&gt;&lt;BR /&gt;What do you have and what do you want to do?&lt;BR /&gt;&lt;BR /&gt;Dates are not datetimes and vice versa and needed to be treated differently. Also, you specify datetimes with a DT at the end, not a D. &lt;BR /&gt;&lt;BR /&gt;Common literals are:&lt;BR /&gt;&lt;BR /&gt;D - Date&lt;BR /&gt;DT - Datetime&lt;BR /&gt;N - Named variable or dataset</description>
      <pubDate>Thu, 03 Oct 2019 21:20:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/filtering-by-date/m-p/593935#M15592</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-03T21:20:07Z</dc:date>
    </item>
  </channel>
</rss>

