<?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: Max and Min for all variables proc means in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414121#M101435</link>
    <description>&lt;P&gt;Here's a variation on your program that should do the trick:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc means data=one noprint;&lt;/P&gt;
&lt;P&gt;var v1-v9;&lt;/P&gt;
&lt;P&gt;output out=minimums (drop=_type_ _freq_) min=;&lt;/P&gt;
&lt;P&gt;output out=maximums (drop=_type_ _freq_) max=;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set minimums (in=mins) maximums;&lt;/P&gt;
&lt;P&gt;if mins then type='min'; else type='max';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Nov 2017 20:29:21 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-11-16T20:29:21Z</dc:date>
    <item>
      <title>Max and Min for all variables proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414104#M101426</link>
      <description>&lt;P&gt;Hi for all!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with numeric values. I think proc means its easier for do it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input var1-var9 @@;
datalines;
9	2	6	8	8	9	7	8	2
9	9	6	6	10	6	0	2	5
4	5	3	4	4	4	7	10	3
4	9	3	8	7	3	7	2	9
6	10	2	6	6	5	8	10	8
0	3	10	9	9	9	9	1	0
6	2	9	6	9	3	1	0	7
4	7	9	2	8	10	10	0	10
3	8	1	10	0	5	10	8	2
9	1	5	9	7	3	0	3	6
0	1	0	9	3	10	3	0	2

;
run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc means data=one noprint max min MAXDEC = 0 ; OUTPUT OUT=temp(drop=_type_&amp;nbsp; _freq_) max=&amp;nbsp; min=;run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But i have error (varn it's already defined) How can i obtain dataset like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
max	9	10	10	10	10	10	10	10	10
min	0	1	0	2	0	3	0	0	0&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 19:04:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414104#M101426</guid>
      <dc:creator>dali74</dc:creator>
      <dc:date>2017-11-16T19:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Max and Min for all variables proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414115#M101431</link>
      <description>&lt;P&gt;Use the ODS table instead of the OUTPUT table which isn't structured the way you want it, in conjunction with the STACKODS option.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#p17h6q7ygvkl1sn13qzf947dundi.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#p17h6q7ygvkl1sn13qzf947dundi.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/174314"&gt;@dali74&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi for all!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset with numeric values. I think proc means its easier for do it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input var1-var9 @@;
datalines;
9	2	6	8	8	9	7	8	2
9	9	6	6	10	6	0	2	5
4	5	3	4	4	4	7	10	3
4	9	3	8	7	3	7	2	9
6	10	2	6	6	5	8	10	8
0	3	10	9	9	9	9	1	0
6	2	9	6	9	3	1	0	7
4	7	9	2	8	10	10	0	10
3	8	1	10	0	5	10	8	2
9	1	5	9	7	3	0	3	6
0	1	0	9	3	10	3	0	2

;
run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc means data=one noprint max min MAXDEC = 0 ; OUTPUT OUT=temp(drop=_type_&amp;nbsp; _freq_) max=&amp;nbsp; min=;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But i have error (varn it's already defined) How can i obtain dataset like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
max	9	10	10	10	10	10	10	10	10
min	0	1	0	2	0	3	0	0	0&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 20:21:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414115#M101431</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-16T20:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Max and Min for all variables proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414119#M101433</link>
      <description>&lt;P&gt;But i would like to save dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I saw this option:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sgf/2015/07/17/customizing-output-from-proc-means/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2015/07/17/customizing-output-from-proc-means/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 20:28:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414119#M101433</guid>
      <dc:creator>dali74</dc:creator>
      <dc:date>2017-11-16T20:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Max and Min for all variables proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414120#M101434</link>
      <description>&lt;P&gt;something like this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
infile datalines dlm='09'x ;
input var1-var9 @@ ;
datalines;
9	2	6	8	8	9	7	8	2
9	9	6	6	10	6	0	2	5
4	5	3	4	4	4	7	10	3
4	9	3	8	7	3	7	2	9
6	10	2	6	6	5	8	10	8
0	3	10	9	9	9	9	1	0
6	2	9	6	9	3	1	0	7
4	7	9	2	8	10	10	0	10
3	8	1	10	0	5	10	8	2
9	1	5	9	7	3	0	3	6
0	1	0	9	3	10	3	0	2

;
proc means data=one noprint max min MAXDEC = 0 ; 


OUTPUT OUT=temp (where=( _stat_= "MIN" or _stat_= "MAX" ) drop=_type_  _freq_ );

run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Nov 2017 20:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414120#M101434</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2017-11-16T20:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Max and Min for all variables proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414121#M101435</link>
      <description>&lt;P&gt;Here's a variation on your program that should do the trick:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc means data=one noprint;&lt;/P&gt;
&lt;P&gt;var v1-v9;&lt;/P&gt;
&lt;P&gt;output out=minimums (drop=_type_ _freq_) min=;&lt;/P&gt;
&lt;P&gt;output out=maximums (drop=_type_ _freq_) max=;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set minimums (in=mins) maximums;&lt;/P&gt;
&lt;P&gt;if mins then type='min'; else type='max';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 20:29:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414121#M101435</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-11-16T20:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Max and Min for all variables proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414123#M101437</link>
      <description>Yes it works fine.&lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Thu, 16 Nov 2017 20:32:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414123#M101437</guid>
      <dc:creator>dali74</dc:creator>
      <dc:date>2017-11-16T20:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Max and Min for all variables proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414124#M101438</link>
      <description>&lt;P&gt;If all you want to do is make a data set you could do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data two;
	set one;
	mymax = max (of var1-var9);
	mymin = min (of var1-var9);
	drop var1-var9;
run;
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I feel i would be negligent if i didn't say your data structure could use improvement.&amp;nbsp; By that I mean I would advise having a key in the form of a record id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 20:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414124#M101438</guid>
      <dc:creator>HB</dc:creator>
      <dc:date>2017-11-16T20:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Max and Min for all variables proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414125#M101439</link>
      <description>&lt;P&gt;See&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37783"&gt;@kiranv_&lt;/a&gt;&amp;nbsp;solution!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 20:34:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414125#M101439</guid>
      <dc:creator>dali74</dc:creator>
      <dc:date>2017-11-16T20:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Max and Min for all variables proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414126#M101440</link>
      <description>&lt;P&gt;It does save as a data set!&lt;/P&gt;
&lt;P&gt;But&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37783"&gt;@kiranv_&lt;/a&gt;&amp;nbsp;answer is better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/174314"&gt;@dali74&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;But i would like to save dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I saw this option:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sgf/2015/07/17/customizing-output-from-proc-means/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2015/07/17/customizing-output-from-proc-means/&lt;/A&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 20:35:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414126#M101440</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-16T20:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Max and Min for all variables proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414128#M101442</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/6401"&gt;@HB&lt;/a&gt;&amp;nbsp;Min/Max in a data step wouldn't work the same way, those are row wise operations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 20:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414128#M101442</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-16T20:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Max and Min for all variables proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414130#M101443</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; I assumed he was min-maxing by row.&amp;nbsp; Apparently he is min-maxing by column.&amp;nbsp; It would be nice if posters said what they wanted, wouldn't it?&amp;nbsp; Lol.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Min-maxing by column means s/he's lucky I didn't post an PROC SQL solution.&amp;nbsp; Ha.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 20:42:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414130#M101443</guid>
      <dc:creator>HB</dc:creator>
      <dc:date>2017-11-16T20:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Max and Min for all variables proc means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414143#M101453</link>
      <description />
      <pubDate>Thu, 16 Nov 2017 21:11:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Max-and-Min-for-all-variables-proc-means/m-p/414143#M101453</guid>
      <dc:creator>dali74</dc:creator>
      <dc:date>2017-11-16T21:11:53Z</dc:date>
    </item>
  </channel>
</rss>

