<?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: PROC SQL determine min rate in the past 36 days in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-determine-min-rate-in-the-past-36-days/m-p/49054#M13306</link>
    <description>The following should give you what you want. The where clause can be used to fit your criteria. Hope this helps.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
  DATA TMP;&lt;BR /&gt;
  INPUT PRODUCT $ TREATMENT $ DATE $ RATE MINRATE;&lt;BR /&gt;
  DATALINES;&lt;BR /&gt;
Mortgage High 2011-02-28 2.29 2.29&lt;BR /&gt;
Mortgage High 2011-03-01 2.19 2.19&lt;BR /&gt;
Mortgage High 2011-03-02 2.09 2.09&lt;BR /&gt;
Mortgage Med 2011-02-28 3.29 3.29&lt;BR /&gt;
Mortgage Med 2011-03-01 3.19 3.19&lt;BR /&gt;
Mortgage Med 2011-03-02 3.09 3.09&lt;BR /&gt;
Mortgage Low 2011-02-28 4.29 4.29&lt;BR /&gt;
Mortgage Low 2011-03-01 4.19 4.19&lt;BR /&gt;
Mortgage Low 2011-03-02 4.09 4.09&lt;BR /&gt;
Mortgage Low 2011-03-03 4.99 4.09 &lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
  PROC SQL;&lt;BR /&gt;
    CREATE TABLE TMPTABLE AS &lt;BR /&gt;
      SELECT PRODUCT, TREATMENT,  MIN(RATE) AS LOWESTRATE FROM TMP GROUP BY PRODUCT, TREATMENT;&lt;BR /&gt;
  QUIT;</description>
    <pubDate>Wed, 13 Apr 2011 17:12:47 GMT</pubDate>
    <dc:creator>buckeye</dc:creator>
    <dc:date>2011-04-13T17:12:47Z</dc:date>
    <item>
      <title>PROC SQL determine min rate in the past 36 days</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-determine-min-rate-in-the-past-36-days/m-p/49053#M13305</link>
      <description>I am trying to build a query to determine the min rate in the past 36 days.&lt;BR /&gt;
&lt;BR /&gt;
for this example, I will only specify 2 days to make the example small.&lt;BR /&gt;
&lt;BR /&gt;
For this example I need to check each row in the following table and determine the minimum rate for each group of records for the past 2 days. &lt;BR /&gt;
&lt;BR /&gt;
In reality I need to check the past 36 days...&lt;BR /&gt;
&lt;BR /&gt;
Product   Treatment  Date           Rate    Min-Rate&lt;BR /&gt;
====================================&lt;BR /&gt;
&lt;BR /&gt;
Mortgage High          2011-02-28  2.29    2.29 &lt;BR /&gt;
Mortgage High          2011-03-01  2.19    2.19 &lt;BR /&gt;
Mortgage High          2011-03-02  2.09    2.09 &lt;BR /&gt;
&lt;BR /&gt;
Mortgage Med          2011-02-28  3.29    3.29 &lt;BR /&gt;
Mortgage Med          2011-03-01  3.19    3.19 &lt;BR /&gt;
Mortgage Med          2011-03-02  3.09    3.09 &lt;BR /&gt;
&lt;BR /&gt;
Mortgage Low           2011-02-28  4.29    4.29 &lt;BR /&gt;
Mortgage Low           2011-03-01  4.19    4.19 &lt;BR /&gt;
Mortgage Low           2011-03-02  4.09    4.09 &lt;BR /&gt;
Mortgage Low           2011-03-03  4.99    4.09 &lt;BR /&gt;
&lt;BR /&gt;
For each date record, I need to examine the past &lt;BR /&gt;
2 days and determine the minimum rate within each&lt;BR /&gt;
group ( Mortgage High, Mortgage Med, Mortgage Low )&lt;BR /&gt;
 &lt;BR /&gt;
I think I may need to use a subquery, but not sure on&lt;BR /&gt;
the coding, &lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Tue, 12 Apr 2011 23:45:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-determine-min-rate-in-the-past-36-days/m-p/49053#M13305</guid>
      <dc:creator>wildhogs</dc:creator>
      <dc:date>2011-04-12T23:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL determine min rate in the past 36 days</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-determine-min-rate-in-the-past-36-days/m-p/49054#M13306</link>
      <description>The following should give you what you want. The where clause can be used to fit your criteria. Hope this helps.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
  DATA TMP;&lt;BR /&gt;
  INPUT PRODUCT $ TREATMENT $ DATE $ RATE MINRATE;&lt;BR /&gt;
  DATALINES;&lt;BR /&gt;
Mortgage High 2011-02-28 2.29 2.29&lt;BR /&gt;
Mortgage High 2011-03-01 2.19 2.19&lt;BR /&gt;
Mortgage High 2011-03-02 2.09 2.09&lt;BR /&gt;
Mortgage Med 2011-02-28 3.29 3.29&lt;BR /&gt;
Mortgage Med 2011-03-01 3.19 3.19&lt;BR /&gt;
Mortgage Med 2011-03-02 3.09 3.09&lt;BR /&gt;
Mortgage Low 2011-02-28 4.29 4.29&lt;BR /&gt;
Mortgage Low 2011-03-01 4.19 4.19&lt;BR /&gt;
Mortgage Low 2011-03-02 4.09 4.09&lt;BR /&gt;
Mortgage Low 2011-03-03 4.99 4.09 &lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
  PROC SQL;&lt;BR /&gt;
    CREATE TABLE TMPTABLE AS &lt;BR /&gt;
      SELECT PRODUCT, TREATMENT,  MIN(RATE) AS LOWESTRATE FROM TMP GROUP BY PRODUCT, TREATMENT;&lt;BR /&gt;
  QUIT;</description>
      <pubDate>Wed, 13 Apr 2011 17:12:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-determine-min-rate-in-the-past-36-days/m-p/49054#M13306</guid>
      <dc:creator>buckeye</dc:creator>
      <dc:date>2011-04-13T17:12:47Z</dc:date>
    </item>
  </channel>
</rss>

