<?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: SAS_Count Frequency in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372589#M276058</link>
    <description>&lt;P&gt;Hi, another idea (not &amp;nbsp;1 million groups, but 12 million observations &amp;nbsp;... SUMMARY + TRANSPOSE juts a few seconds). I don't &amp;nbsp;see in your exmaple output the need to rank counts within groups.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data x;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;input (group category) (:$1.) @@;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;A 1 A 1 A 2 A 1 A 2 A 3&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;B 1 B 2 B 2 B 1 B 3 B 2&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;;&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data bigx;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;set x;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;do _n_=1 to 1e6;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;output;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;proc summary data=bigx nway;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;class group category;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;output out=y (drop=_type_); &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;proc transpose data=y out=z (drop=_name_) prefix=cat;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;by group;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;var _freq_;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;id category;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;DATA SET: z&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;group &amp;nbsp; &amp;nbsp;cat1 &amp;nbsp; &amp;nbsp; cat2 &amp;nbsp; &amp;nbsp; cat3&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp;3000000 &amp;nbsp;2000000 &amp;nbsp; 1000000&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; B &amp;nbsp; &amp;nbsp; &amp;nbsp;2000000 &amp;nbsp;3000000 &amp;nbsp; 1000000&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 02 Jul 2017 17:47:28 GMT</pubDate>
    <dc:creator>MikeZdeb</dc:creator>
    <dc:date>2017-07-02T17:47:28Z</dc:date>
    <item>
      <title>SAS_Count Frequency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372434#M276051</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to ask a complicated (for me) question about SAS programming. I think I can explain better by using simple example. So, I have the following dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Group &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Category&amp;nbsp;&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to count the each category for each group. I can do it by using PROC FREQ. But it is not better way for my dataset. It will be time consuming for me as my dataset is too large and I have a huge number of groups. So, if I use PROC FREQ, firstly I need to create new datasets for each group and then use PROC FREQ for each group. In sum, I need to create the following dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CATEGORIES&amp;nbsp;&lt;/P&gt;&lt;P&gt;Group &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; (first category) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp;&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3 (the number of first category in A group is 3) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp;&lt;SPAN&gt;(the number of first category in B group is 2)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I do not write explainations for second and third categories as it is the same with the first category.I think I can explain it. Thanks for your helps.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2017 17:41:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372434#M276051</guid>
      <dc:creator>Khaladdin</dc:creator>
      <dc:date>2017-07-01T17:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS_Count Frequency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372437#M276052</link>
      <description>&lt;P&gt;You wrote that you have " a huge number of groups". How huge is it ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try to run:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=have;
    table group*category / nopercent 
       out=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 01 Jul 2017 18:26:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372437#M276052</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-01T18:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS_Count Frequency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372439#M276053</link>
      <description>Thanks for reply. It is high frequency data. So, I have more than one million groups.</description>
      <pubDate>Sat, 01 Jul 2017 18:43:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372439#M276053</guid>
      <dc:creator>Khaladdin</dc:creator>
      <dc:date>2017-07-01T18:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS_Count Frequency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372440#M276054</link>
      <description>&lt;P&gt;If it takes too much time or you are short with memory, add a sort:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have; by group; run;

proc freq data=have;
    by group;
    table group*category / nopercent 
       out=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 01 Jul 2017 18:50:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372440#M276054</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-01T18:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS_Count Frequency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372441#M276055</link>
      <description>Many thanks. I will try it tomorrow. I will let you know about the result. Many thanks agaib.</description>
      <pubDate>Sat, 01 Jul 2017 18:53:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372441#M276055</guid>
      <dc:creator>Khaladdin</dc:creator>
      <dc:date>2017-07-01T18:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS_Count Frequency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372444#M276056</link>
      <description>&lt;P&gt;It appears to me that you want, for each group, to rank categories for each group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then produce one obs for each group with variables CAT1, CAT2, .... CATj.&amp;nbsp;&amp;nbsp; CAT1 will contain the most frequent category (what I think you mean by "first category"), CAT2 the second most frequent, through CATj (where J is the number of distinct categories in the group having the highest cardinatliy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your data are aleady sorted by group, it's two steps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Use proc freq to generate a data set T1&amp;nbsp;of frequencies sorted by GROUP and then descending frequency ("order=freq") within group.&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=have noprint order=freq;
  by group;
  table category / out=t1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;Then just use proc transpose to collapse the descending frequencies for each group into a single row with vars CAT1, CAT2, ...&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=t1 out=want  prefix=CAT;
  by group;
  var category;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now if your data are NOT sorted, it's three steps - but don't worry - you don't have to sort the original data, just the frequencies:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;(and 2) Get frequencies of group*category and sort by descending frequency within each group:
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=have noprint ;
  table group * category / out=t1;
run;
proc sort data=t1;
  by group descending count;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;(see above)&lt;/LI&gt;
&lt;LI&gt;Now transpose a column to a row for each group.&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=t1 prefix=CAT;
  by group;
  var category;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2017 20:44:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372444#M276056</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-07-01T20:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS_Count Frequency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372516#M276057</link>
      <description>Frequency works. But, transpose does not work.</description>
      <pubDate>Sun, 02 Jul 2017 08:37:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372516#M276057</guid>
      <dc:creator>Khaladdin</dc:creator>
      <dc:date>2017-07-02T08:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS_Count Frequency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372589#M276058</link>
      <description>&lt;P&gt;Hi, another idea (not &amp;nbsp;1 million groups, but 12 million observations &amp;nbsp;... SUMMARY + TRANSPOSE juts a few seconds). I don't &amp;nbsp;see in your exmaple output the need to rank counts within groups.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data x;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;input (group category) (:$1.) @@;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;A 1 A 1 A 2 A 1 A 2 A 3&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;B 1 B 2 B 2 B 1 B 3 B 2&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;;&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data bigx;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;set x;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;do _n_=1 to 1e6;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;output;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;proc summary data=bigx nway;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;class group category;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;output out=y (drop=_type_); &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;proc transpose data=y out=z (drop=_name_) prefix=cat;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;by group;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;var _freq_;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;id category;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;DATA SET: z&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;group &amp;nbsp; &amp;nbsp;cat1 &amp;nbsp; &amp;nbsp; cat2 &amp;nbsp; &amp;nbsp; cat3&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp;3000000 &amp;nbsp;2000000 &amp;nbsp; 1000000&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; B &amp;nbsp; &amp;nbsp; &amp;nbsp;2000000 &amp;nbsp;3000000 &amp;nbsp; 1000000&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 17:47:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/372589#M276058</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2017-07-02T17:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS_Count Frequency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/373486#M276059</link>
      <description>&lt;P&gt;Show the log of the non-working code please.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 01:54:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Count-Frequency/m-p/373486#M276059</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-07-06T01:54:53Z</dc:date>
    </item>
  </channel>
</rss>

