<?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: use date in a select range in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/use-date-in-a-select-range/m-p/45650#M12032</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Udo, I remembered after I posted it.. but thought there was a different approach with different formats.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Feb 2012 21:06:41 GMT</pubDate>
    <dc:creator>podarum</dc:creator>
    <dc:date>2012-02-03T21:06:41Z</dc:date>
    <item>
      <title>use date in a select range</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/use-date-in-a-select-range/m-p/45646#M12028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, any reason why I can use the Date (format YYMMP7.) in a range?&amp;nbsp; for example I want to select records that fall within&amp;nbsp; if Date =&amp;gt; 2001.01 and Date &amp;lt;= 2011.11&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Feb 2012 20:00:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/use-date-in-a-select-range/m-p/45646#M12028</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-02-03T20:00:58Z</dc:date>
    </item>
    <item>
      <title>use date in a select range</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/use-date-in-a-select-range/m-p/45647#M12029</link>
      <description>&lt;P&gt;I got it..&amp;nbsp; if Date =&amp;gt; "01Jan2001"d and Date &amp;lt;= "01Nov2011"d;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Shorthand that uses the equality operators but no need for AND:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp; if&amp;nbsp; "01Jan2001"d &amp;lt;= Date &amp;lt;=&amp;nbsp;"01Nov2011"d;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also use WHERE and BETWEEN (it really means between + the two dates) ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;where date between "01Jan2001"d and "01Nov2011"d;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this also works ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;where date between &lt;SPAN&gt;"01Nov2011"d and "01Jan2001"d ;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 14:26:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/use-date-in-a-select-range/m-p/45647#M12029</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2017-02-22T14:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: use date in a select range</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/use-date-in-a-select-range/m-p/45648#M12030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;hi ... if you are using a SAS data set, you could also use WHERE and BETWEEN (it really means between + the two dates) ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;where date between &lt;SPAN style="background-color: #eef4f9;"&gt; "01Jan2001"d and "01Nov2011"d;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this also works ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;where date between &lt;SPAN style="background-color: #eef4f9;"&gt;"01Nov2011"d and &lt;STRONG style="background-color: #eef4f9; font-family: 'courier new', courier;"&gt;"01Jan2001"d &lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG style="background-color: #eef4f9;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Feb 2012 20:55:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/use-date-in-a-select-range/m-p/45648#M12030</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-02-03T20:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: use date in a select range</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/use-date-in-a-select-range/m-p/45649#M12031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi - &lt;/P&gt;&lt;P&gt;Just to confirm your understanding: &lt;/P&gt;&lt;P&gt;In SAS, every date is a unique number on a number line. Dates before January 1, 1960, are negative numbers; those after January 1, 1960, are positive. &lt;/P&gt;&lt;P&gt;To write a SAS date constant (in IF or WHERE statements for example), enclose a date in quotation marks in the standard SAS form &lt;SPAN class="strong"&gt;ddMMMyyyy &lt;/SPAN&gt;and immediately follow the final quotation mark with the letter D. &lt;/P&gt;&lt;P&gt;The D suffix tells SAS to convert the calendar date to a SAS date value. Of course you could also use the unformatted numeric value instead. &lt;/P&gt;&lt;P&gt;Example: &lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set sashelp.air(where=(date=0)) sashelp.air(where=(date="01JAN1960"d));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Feb 2012 21:03:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/use-date-in-a-select-range/m-p/45649#M12031</guid>
      <dc:creator>udo_sas</dc:creator>
      <dc:date>2012-02-03T21:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: use date in a select range</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/use-date-in-a-select-range/m-p/45650#M12032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Udo, I remembered after I posted it.. but thought there was a different approach with different formats.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Feb 2012 21:06:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/use-date-in-a-select-range/m-p/45650#M12032</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-02-03T21:06:41Z</dc:date>
    </item>
  </channel>
</rss>

