<?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 calculate with a minimum from the variablelist in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/calculate-with-a-minimum-from-the-variablelist/m-p/75475#M16254</link>
    <description>Hi all,&lt;BR /&gt;
&lt;BR /&gt;
I have a variable x. Now I want to select some of the observations. I want to start with 10units above the minimum and end at minimum plus 30units.&lt;BR /&gt;
but it doesnt work when I use&lt;BR /&gt;
where x between min(x+10) and min(x+30);&lt;BR /&gt;
The min Function take only singlenumbers limitetd by comma.&lt;BR /&gt;
&lt;BR /&gt;
Have anybody an idea to solve this problem?&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
    <pubDate>Wed, 25 Feb 2009 14:51:08 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-02-25T14:51:08Z</dc:date>
    <item>
      <title>calculate with a minimum from the variablelist</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-with-a-minimum-from-the-variablelist/m-p/75475#M16254</link>
      <description>Hi all,&lt;BR /&gt;
&lt;BR /&gt;
I have a variable x. Now I want to select some of the observations. I want to start with 10units above the minimum and end at minimum plus 30units.&lt;BR /&gt;
but it doesnt work when I use&lt;BR /&gt;
where x between min(x+10) and min(x+30);&lt;BR /&gt;
The min Function take only singlenumbers limitetd by comma.&lt;BR /&gt;
&lt;BR /&gt;
Have anybody an idea to solve this problem?&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Wed, 25 Feb 2009 14:51:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-with-a-minimum-from-the-variablelist/m-p/75475#M16254</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-02-25T14:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: calculate with a minimum from the variablelist</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-with-a-minimum-from-the-variablelist/m-p/75476#M16255</link>
      <description>You are correct - the WHERE statement (as the same with the IF stmt) will only interrogate the current observation.  You need to use PROC SUMMARY/MEANS to generate a file containing the MIN and MAX as new variables, and then one option is to MERGE the resulting file back into your SAS file - then you have the MIN and MAX value range (again, as unique SAS variables created in the MEANS/SUMMARY step) to use in your WHERE statement.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 25 Feb 2009 23:29:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-with-a-minimum-from-the-variablelist/m-p/75476#M16255</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-02-25T23:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: calculate with a minimum from the variablelist</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-with-a-minimum-from-the-variablelist/m-p/75477#M16256</link>
      <description>It might not be the beautiest of solutions, but works with smaller datasets:&lt;BR /&gt;
&lt;BR /&gt;
Proc sql;&lt;BR /&gt;
 select * &lt;BR /&gt;
 from sashelp.class&lt;BR /&gt;
 where age between &lt;BR /&gt;
        (select min(age) + 2 from sashelp.class)&lt;BR /&gt;
   and &lt;BR /&gt;
        (select max(age) - 2 from sashelp.class)&lt;BR /&gt;
 ;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
//Fredrik</description>
      <pubDate>Thu, 26 Feb 2009 09:07:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-with-a-minimum-from-the-variablelist/m-p/75477#M16256</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2009-02-26T09:07:16Z</dc:date>
    </item>
  </channel>
</rss>

