<?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: How to - Get Proc Tabulate's Report Output Being A Data Set By Using Proc Means in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281651#M59111</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;&amp;nbsp;Thank you fro trying to help me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in EG 5.1, Median function gives the following error. And this warning lead to prevent grouping calculation. Do you have an idea how to avoid this situation?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00FF00"&gt;WARNING: The MEDIAN function has been called with only one argument.&amp;nbsp; However, it is not an SQL aggregate function, and this call&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00FF00"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;will not cause SQL aggregation.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Jul 2016 08:09:59 GMT</pubDate>
    <dc:creator>turcay</dc:creator>
    <dc:date>2016-07-01T08:09:59Z</dc:date>
    <item>
      <title>How to - Get Proc Tabulate's Report Output Being A Data Set By Using Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281503#M59100</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to get PROC TABULATE's report output as a data set. But as we know, it is not possible to get the data set by using OUT= option in PROC TABULATE.&amp;nbsp;So that, I decided to use PROC MEANS procedure and get the same structure with PROC TABULATE's report output. I almost got the same output except the "Target"(0&amp;amp;1) values. How can I get these values in my desired data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can somebody help me, please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Have;
Length Predicted 8 Target 8 Bucket 8;
Infile Datalines Missover;
Input Predicted Target Bucket;
Datalines;
0.7 0 1
0.6 0 2
0.8 1 3
0.7 0 2
0.6 0 3
0.8 1 1
0.7 0 3
0.6 0 1
0.8 1 2
0.7 0 1
0.6 0 2
0.8 1 3
0.7 0 2
0.6 0 1
0.8 1 3
;
Run;
Ods Listing Close;
ODS OUTPUT Summary=Want(Rename=(MEAN=_MEAN MIN=_MIN MAX=_MAX MEDIAN=_MEDIAN N=_N));
PROC MEANS Data=Have MEAN MIN MAX MEDIAN N STACKODSOUTPUT;
VAR Predicted;
CLASS Bucket;
Run;
 
Ods Output Close; 
Ods Listing; 
PROC TABULATE DATA=Have FORMAT=BEST12.8 Out=Have;
     VAR Predicted;
     CLASS Target /  ORDER=UNFORMATTED MISSING;
     CLASS Bucket /  ORDER=UNFORMATTED MISSING;
     TABLE /* Row Dimension */
Bucket,
/* Column Dimension */
Predicted*(Mean Min Max Median) Target*N N;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 17:06:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281503#M59100</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-06-30T17:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Get Proc Tabulate's Report Output Being A Data Set By Using Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281524#M59102</link>
      <description>&lt;P&gt;Actually PROC TABULATE does support OUT= on the PROC statement.&amp;nbsp; Maybe that will make things easier.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 17:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281524#M59102</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-30T17:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Get Proc Tabulate's Report Output Being A Data Set By Using Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281538#M59103</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for trying to help me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; But I know the PROC TABULATE supports OUT= option but I want to see the following data set. How can I get this? PROC TABULATE OUT= optipn does not brings this data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3862iD9A4A0F018478147/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Desired.png" title="Desired.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 18:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281538#M59103</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-06-30T18:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Get Proc Tabulate's Report Output Being A Data Set By Using Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281597#M59105</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I do NOT believe that you will every get Target 0/1 numbers as you want, from PROC MEANS, in the same way that you can do with PROC TABULATE. However, (and I am not just saying this because I really like PROC REPORT), PROC REPORT can give you EXACTLY what you want in a report format and a DATASET format, as shown in the attached output:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3871i97010A59B684D9DF/image-size/original?v=v2&amp;amp;px=-1" alt="comparison_of_outputs.png" title="comparison_of_outputs.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So rather than spin your wheels trying to make PROC MEANS do something that PROC TABULATE or PROC REPORT could do better, why not just use PROC TABULATE if all you need is report output or use PROC REPORT if you need a report and/or a dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 01:22:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281597#M59105</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-07-01T01:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Get Proc Tabulate's Report Output Being A Data Set By Using Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281605#M59106</link>
      <description>&lt;P&gt;Use SQL instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Have;
Length Predicted 8 Target 8 Bucket 8;
Infile Datalines Missover;
Input Predicted Target Bucket;
Datalines;
0.7 0 1
0.6 0 2
0.8 1 3
0.7 0 2
0.6 0 3
0.8 1 1
0.7 0 3
0.6 0 1
0.8 1 2
0.7 0 1
0.6 0 2
0.8 1 3
0.7 0 2
0.6 0 1
0.8 1 3
;
Run;
proc sql;
select Bucket,
       mean(Predicted) as mean,
       min(Predicted) as min,
       max(Predicted) as max,
       median(Predicted) as median,
       sum(Target=0) as Target_0,
       sum(Target=1) as Target_1,
       (select count(*) from have) as n
 from have
   group by Bucket;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3872i0F3C56E986CE08BE/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="x.png" title="x.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 02:24:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281605#M59106</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-07-01T02:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Get Proc Tabulate's Report Output Being A Data Set By Using Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281651#M59111</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;&amp;nbsp;Thank you fro trying to help me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in EG 5.1, Median function gives the following error. And this warning lead to prevent grouping calculation. Do you have an idea how to avoid this situation?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00FF00"&gt;WARNING: The MEDIAN function has been called with only one argument.&amp;nbsp; However, it is not an SQL aggregate function, and this call&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#00FF00"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;will not cause SQL aggregation.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 08:09:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281651#M59111</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-07-01T08:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Get Proc Tabulate's Report Output Being A Data Set By Using Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281661#M59115</link>
      <description>&lt;P&gt;What version of SAS are you using ? if it is not SAS9.4 , you can't use MEDIAN() in SQL.&lt;/P&gt;
&lt;P&gt;The workaround way is computing MEDIAN in PROC MEANS ,then merged it back to the SQL's dataset .&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 08:35:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281661#M59115</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-07-01T08:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Get Proc Tabulate's Report Output Being A Data Set By Using Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281667#M59116</link>
      <description>&lt;P&gt;Yes, It is not 9.4 It is 9.4 okay I will merge PROC MEANS Median with PROC SQL output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 09:16:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281667#M59116</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-07-01T09:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Get Proc Tabulate's Report Output Being A Data Set By Using Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281720#M59119</link>
      <description>Or, you could use PROC REPORT, which does give you the MEDIAN function and would not require more than 1 pass through the data.&lt;BR /&gt;&lt;BR /&gt;Just sayin'&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Fri, 01 Jul 2016 13:39:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281720#M59119</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-07-01T13:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Get Proc Tabulate's Report Output Being A Data Set By Using Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281723#M59120</link>
      <description>&lt;P&gt;Thank you very much&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, you are right but after I got the output I will do some additional calculations so that is the reason why I select the PROC SQL because doing some calculations over the PROC SQL is easier than the PROC REPORT calculation. But in terms of performance, I do not have much knowledge. Maybe PROC REPORT is better than PROC SQL with regard to performance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 13:46:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-Get-Proc-Tabulate-s-Report-Output-Being-A-Data-Set-By/m-p/281723#M59120</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-07-01T13:46:26Z</dc:date>
    </item>
  </channel>
</rss>

