<?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 output histogram database in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413076#M101066</link>
    <description>Yes, I tried. I use "ODS OUTPUT HistogramBins=output;", but it doesn't work here.</description>
    <pubDate>Mon, 13 Nov 2017 21:24:24 GMT</pubDate>
    <dc:creator>hua</dc:creator>
    <dc:date>2017-11-13T21:24:24Z</dc:date>
    <item>
      <title>How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413056#M101058</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using proc univariate to create a histogram of my data, anyone knows how to output the midpoints of each bin and the corresponding percentage?&lt;/P&gt;
&lt;P&gt;The code I use is:&lt;/P&gt;
&lt;PRE&gt;proc univariate data=have;
where Prep&amp;gt;=0.5 and Prep&amp;lt;130.5;
histogram Prep / endpoints=(0.5 to 130 by 5);
run;&lt;/PRE&gt;
&lt;P&gt;By using this code, I could get the histogram, with my own defined endpoint and interval. But I don't know how to output a table (dataset) including the midpoints (or endpoints) and its percentage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc freq can produce the percentage of every value in my data, but not for the bins.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 21:05:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413056#M101058</guid>
      <dc:creator>hua</dc:creator>
      <dc:date>2017-11-13T21:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413058#M101059</link>
      <description>&lt;P&gt;Have you tried capturing the ODS Table?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 21:06:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413058#M101059</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-13T21:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413072#M101063</link>
      <description>Hi Reeza, I read the link, but I don't think ODS can help to output the midpoints and percentage, because there has no options for the table I want. Or could you tell me more details about it? Thank you so much!</description>
      <pubDate>Mon, 13 Nov 2017 21:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413072#M101063</guid>
      <dc:creator>hua</dc:creator>
      <dc:date>2017-11-13T21:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413075#M101065</link>
      <description>&lt;P&gt;Did you try it and it didn't work, or did you make that decision before trying it?&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/55231"&gt;@hua&lt;/a&gt; wrote:&lt;BR /&gt;Hi Reeza, I read the link, but I don't think ODS can help to output the midpoints and percentage, because there has no options for the table I want. Or could you tell me more details about it? Thank you so much!&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 21:22:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413075#M101065</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-13T21:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413076#M101066</link>
      <description>Yes, I tried. I use "ODS OUTPUT HistogramBins=output;", but it doesn't work here.</description>
      <pubDate>Mon, 13 Nov 2017 21:24:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413076#M101066</guid>
      <dc:creator>hua</dc:creator>
      <dc:date>2017-11-13T21:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413078#M101067</link>
      <description>&lt;P&gt;The output wasn't named HistogramBins in the ODS TRACE step...&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 21:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413078#M101067</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-13T21:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413079#M101068</link>
      <description>You can also check the documentation for the ODS table name.</description>
      <pubDate>Mon, 13 Nov 2017 21:25:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413079#M101068</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-13T21:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413082#M101070</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="QQ图片20171113162955.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16609iEC76B5C18B7A4BB9/image-size/large?v=v2&amp;amp;px=999" role="button" title="QQ图片20171113162955.png" alt="QQ图片20171113162955.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hi Reeza, this is what I found, I think the table name is HistogramBins, did&amp;nbsp;I misunderstand this option?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 21:32:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413082#M101070</guid>
      <dc:creator>hua</dc:creator>
      <dc:date>2017-11-13T21:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413083#M101071</link>
      <description>&lt;P&gt;Nope, but it does appear the documentation may be wrong. This is why I recommend the ODS TRACE options instead - run the proc with ODS TRACE ON; &amp;lt;procedure code&amp;gt; ;; ODS TRACE OFF; Then capture the name from the log.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try Histogram instead, this works for me - SAS 9.4 TS1M4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods table histogram=want;;
proc univariate data=sashelp.cars;
histogram mpg_highway / endpoints=(0 to 80 by 5);;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Nov 2017 21:35:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413083#M101071</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-13T21:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413089#M101074</link>
      <description>Yes, the Histogram works. And the log do show "histogram" when I use ods trade on and ods trade off. Sorry, I didn't realized I could capture the name before. Thank you for help! thank you so much, Reeza.</description>
      <pubDate>Mon, 13 Nov 2017 21:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413089#M101074</guid>
      <dc:creator>hua</dc:creator>
      <dc:date>2017-11-13T21:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413104#M101076</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/55231"&gt;@hua&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="QQ图片20171113162955.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16609iEC76B5C18B7A4BB9/image-size/large?v=v2&amp;amp;px=999" role="button" title="QQ图片20171113162955.png" alt="QQ图片20171113162955.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hi Reeza, this is what I found, I think the table name is HistogramBins, did&amp;nbsp;I misunderstand this option?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You may have missed the part that the Bins or HistogramBins are only created if you use MIDPERCENTS option on the HIstogram statement.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 22:46:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413104#M101076</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-11-13T22:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413114#M101083</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;I checked that, still doesn't work. It's a mistake in the documentation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 23:55:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413114#M101083</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-13T23:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413127#M101089</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;I checked that, still doesn't work. It's a mistake in the documentation.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;ARGGH! I tend to believe the documentation for features I don't use...&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 00:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413127#M101089</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-11-14T00:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413128#M101090</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;I checked that, still doesn't work. It's a mistake in the documentation.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;ARGGH! I tend to believe the documentation for features I don't use...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I double checked, I was wrong and the documentation is sort of right.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. It's MIDPERCENTS - not MIDPOINTS which I had tested. When you use MIDPERCENTS it does produce a table called HistogramBins. Otherwise the table is called Histogram. Which isn't listed in the list.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The inconsistency still doesn't make sense.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 00:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413128#M101090</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-14T00:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413331#M101141</link>
      <description>&lt;P&gt;The easiest way to do this is to use the OUTHIST= option on the HISTOGRAM statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc univariate data=sashelp.cars;
var mpg_city;
histogram mpg_city / midpoints=(5 to 65 by 10)outhist=want;
run;

proc print data=want; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Nov 2017 14:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413331#M101141</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-11-14T14:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413369#M101151</link>
      <description>Yes, it works. By the way, do you know how to get the dataset only without printing the histogram and all the other tables under OUTPUT window? I tried "noprint", but it seems like nothing changed. Thank you, Rick!</description>
      <pubDate>Tue, 14 Nov 2017 15:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413369#M101151</guid>
      <dc:creator>hua</dc:creator>
      <dc:date>2017-11-14T15:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413371#M101153</link>
      <description>&lt;P&gt;Use NOPRINT to suppress the tables and use NOPLOT&amp;nbsp;on the HISTOGRAM statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc univariate data=sashelp.cars noprint;
var mpg_city;
histogram mpg_city / midpoints=(5 to 65 by 10) noplot outhist=want;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Nov 2017 15:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413371#M101153</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-11-14T15:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413373#M101154</link>
      <description>Yes. Also I used "ods select none;" instead of "noprint", and it suppressed all the displays, too. Thank you!</description>
      <pubDate>Tue, 14 Nov 2017 15:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413373#M101154</guid>
      <dc:creator>hua</dc:creator>
      <dc:date>2017-11-14T15:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413375#M101155</link>
      <description>&lt;P&gt;The difference is efficiency: When you use ODS SELECT NONE, the procedure computes everything and sends it to ODS, which then does not display it. When you use NOPRINT and NOPLOT, the procedure computes only the statistics that are needed for the output data sets.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 15:28:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413375#M101155</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-11-14T15:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to output histogram database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413376#M101156</link>
      <description>I got it! Then I will choose to use NOPRINT and NOPLOT. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks!</description>
      <pubDate>Tue, 14 Nov 2017 15:32:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-histogram-database/m-p/413376#M101156</guid>
      <dc:creator>hua</dc:creator>
      <dc:date>2017-11-14T15:32:00Z</dc:date>
    </item>
  </channel>
</rss>

