<?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: Highest value between 4 variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Highest-value-between-4-variables/m-p/386233#M92470</link>
    <description>&lt;P&gt;With your data:&lt;/P&gt;
&lt;PRE&gt;data want;
  a=12; b=11; c=18; d=7;
  max=max(a,b,c,d);
  /* or */
  mx=max(of _numeric_);
run;
&lt;/PRE&gt;
&lt;P&gt;The second will take all numeric variables.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Aug 2017 12:43:02 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-08-08T12:43:02Z</dc:date>
    <item>
      <title>Highest value between 4 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Highest-value-between-4-variables/m-p/386227#M92468</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have four variables A, B, C and D. For each row these variables have integer values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know how to get the value of the highest variable between the 4. FOr example:&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp; &amp;nbsp; &amp;nbsp; C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D&lt;/P&gt;&lt;P&gt;12&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&lt;/P&gt;&lt;P&gt;The result should be 18.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to do this with proc sql.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for help.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 12:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Highest-value-between-4-variables/m-p/386227#M92468</guid>
      <dc:creator>indox</dc:creator>
      <dc:date>2017-08-08T12:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Highest value between 4 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Highest-value-between-4-variables/m-p/386232#M92469</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input A B C D;
	datalines;
	12
	11
	18
	7
	;

proc sql;
	create table want as
	select *
	      ,max(A,B,C,D) as highest_value
	from have;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Aug 2017 12:38:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Highest-value-between-4-variables/m-p/386232#M92469</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-08-08T12:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: Highest value between 4 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Highest-value-between-4-variables/m-p/386233#M92470</link>
      <description>&lt;P&gt;With your data:&lt;/P&gt;
&lt;PRE&gt;data want;
  a=12; b=11; c=18; d=7;
  max=max(a,b,c,d);
  /* or */
  mx=max(of _numeric_);
run;
&lt;/PRE&gt;
&lt;P&gt;The second will take all numeric variables.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 12:43:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Highest-value-between-4-variables/m-p/386233#M92470</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-08T12:43:02Z</dc:date>
    </item>
  </channel>
</rss>

