<?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: maximum value in data set in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/maximum-value-in-data-set/m-p/77065#M22331</link>
    <description>I find questions of the type "I know how to do it in SQL but how do I do it in the data step" a bit strange. I use to ask myself the opposite question - how can I do it in SQL instead? I prefer SQL if performance and coding complexity is the same (or better in SQL). There are in my opinion two advantages by using SQL in such cases:&lt;BR /&gt;
 - Non SAS experts can read and understand the code.&lt;BR /&gt;
 - Running the code against non SAS data can exploit the possibilities of using the benefits in implicit SQL pass-thru, which in turn can increase performance.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Linus</description>
    <pubDate>Tue, 17 Mar 2009 14:53:28 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2009-03-17T14:53:28Z</dc:date>
    <item>
      <title>maximum value in data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/maximum-value-in-data-set/m-p/77063#M22329</link>
      <description>What are the possible methods for  picking  the maximum  value from a  variable  in data set using data step (not using proc sql) .Can  we do it with Max function . can anyone plz explain  with  ex?If not with MAX function any other method using data step . &lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance for your replies</description>
      <pubDate>Tue, 17 Mar 2009 13:43:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/maximum-value-in-data-set/m-p/77063#M22329</guid>
      <dc:creator>keen_sas</dc:creator>
      <dc:date>2009-03-17T13:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: maximum value in data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/maximum-value-in-data-set/m-p/77064#M22330</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
data maximums;&lt;BR /&gt;
*retain a variable which holds the maximum value found so far;&lt;BR /&gt;
retain maximum;&lt;BR /&gt;
set input_dataset;&lt;BR /&gt;
*if you find a higher value then update the maximum;&lt;BR /&gt;
if variable&amp;gt;maximum then maximum=variable;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Your last observation will have the maxmum value in it.&lt;BR /&gt;
&lt;BR /&gt;
There are many other ways but that's a pretty good simple starting point.&lt;BR /&gt;
&lt;BR /&gt;
Cheers&lt;BR /&gt;
Peter

Message was edited by: pznew</description>
      <pubDate>Tue, 17 Mar 2009 14:00:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/maximum-value-in-data-set/m-p/77064#M22330</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-17T14:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: maximum value in data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/maximum-value-in-data-set/m-p/77065#M22331</link>
      <description>I find questions of the type "I know how to do it in SQL but how do I do it in the data step" a bit strange. I use to ask myself the opposite question - how can I do it in SQL instead? I prefer SQL if performance and coding complexity is the same (or better in SQL). There are in my opinion two advantages by using SQL in such cases:&lt;BR /&gt;
 - Non SAS experts can read and understand the code.&lt;BR /&gt;
 - Running the code against non SAS data can exploit the possibilities of using the benefits in implicit SQL pass-thru, which in turn can increase performance.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Linus</description>
      <pubDate>Tue, 17 Mar 2009 14:53:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/maximum-value-in-data-set/m-p/77065#M22331</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-03-17T14:53:28Z</dc:date>
    </item>
  </channel>
</rss>

