<?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 Summary file for discrete value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Summary-file-for-discrete-value/m-p/326168#M72598</link>
    <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;I already have a file in which each variable has noduplicate value.&lt;/P&gt;
&lt;P&gt;I want to create a summary file that show the number of value for each variable in a different format as below&lt;/P&gt;
&lt;P&gt;data have; &lt;BR /&gt;input a b c;&lt;BR /&gt;cards;&lt;BR /&gt;1 1 2 &lt;BR /&gt;-2 2&amp;nbsp;.&lt;BR /&gt;5 3 . &lt;BR /&gt;6 . . &lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want has 2 column: variable_name and number&lt;/P&gt;
&lt;P&gt;a 4 &amp;nbsp;meaning there are 4 values with variable a&lt;/P&gt;
&lt;P&gt;b 3&lt;/P&gt;
&lt;P&gt;c 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since there are hundreds of variables, I dont know how to make it work efficiently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is very much appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;****************************************************&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc summary data=have noprint;&lt;BR /&gt;var _numeric_;&lt;BR /&gt;output out = a n=; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc transpose data=a out=a1;&lt;BR /&gt;var _numeric_;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Proc means data=have stackods N NMISS;&lt;BR /&gt;var _numeric_;&lt;BR /&gt;ods output summary=want;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jan 2017 15:09:22 GMT</pubDate>
    <dc:creator>hhchenfx</dc:creator>
    <dc:date>2017-01-20T15:09:22Z</dc:date>
    <item>
      <title>Summary file for discrete value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary-file-for-discrete-value/m-p/326168#M72598</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;I already have a file in which each variable has noduplicate value.&lt;/P&gt;
&lt;P&gt;I want to create a summary file that show the number of value for each variable in a different format as below&lt;/P&gt;
&lt;P&gt;data have; &lt;BR /&gt;input a b c;&lt;BR /&gt;cards;&lt;BR /&gt;1 1 2 &lt;BR /&gt;-2 2&amp;nbsp;.&lt;BR /&gt;5 3 . &lt;BR /&gt;6 . . &lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want has 2 column: variable_name and number&lt;/P&gt;
&lt;P&gt;a 4 &amp;nbsp;meaning there are 4 values with variable a&lt;/P&gt;
&lt;P&gt;b 3&lt;/P&gt;
&lt;P&gt;c 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since there are hundreds of variables, I dont know how to make it work efficiently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is very much appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;****************************************************&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc summary data=have noprint;&lt;BR /&gt;var _numeric_;&lt;BR /&gt;output out = a n=; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc transpose data=a out=a1;&lt;BR /&gt;var _numeric_;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Proc means data=have stackods N NMISS;&lt;BR /&gt;var _numeric_;&lt;BR /&gt;ods output summary=want;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 15:09:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary-file-for-discrete-value/m-p/326168#M72598</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-01-20T15:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Summary file for discrete value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary-file-for-discrete-value/m-p/326172#M72600</link>
      <description>&lt;P&gt;Since there are no duplicate values, this is really just a count of how many non-missing values exist. &amp;nbsp;This will get it horizontally:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc summary data=have;&lt;/P&gt;
&lt;P&gt;var _numeric_;&lt;/P&gt;
&lt;P&gt;output out=stats (drop=_type_ _freq_) n=;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At this point you could either use the data set STATS, or you could transpose it to get what you described as the WANT data set:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc transpose data=stats out=want (rename=(col1=number));&lt;/P&gt;
&lt;P&gt;var _numeric_;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 03:57:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary-file-for-discrete-value/m-p/326172#M72600</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-01-20T03:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Summary file for discrete value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary-file-for-discrete-value/m-p/326173#M72601</link>
      <description>&lt;P&gt;Proc means with N statistic should calculate this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ods select none;&lt;/P&gt;
&lt;P&gt;Proc means data=SASHELP.class stackods N NMISS;&lt;/P&gt;
&lt;P&gt;var _numeric_;&lt;/P&gt;
&lt;P&gt;ods output summary=want;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;ods select all;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 04:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary-file-for-discrete-value/m-p/326173#M72601</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-20T04:00:11Z</dc:date>
    </item>
  </channel>
</rss>

