<?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: Storing Proc Freq Data in a table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/238806#M43879</link>
    <description>&lt;P&gt;You need to add OUTPCT to add the pct columns to the output data set, check the docs for details.&lt;/P&gt;
&lt;P&gt;This is a bit of a roundabout way to get what you want, but easy enough. Someone else&amp;nbsp;may have a better answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.class;
table age*sex/out=want(drop=pct_row) outpct norow nocum;
run;

proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&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;</description>
    <pubDate>Thu, 10 Dec 2015 23:33:19 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-12-10T23:33:19Z</dc:date>
    <item>
      <title>Storing Proc Freq Data in a table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/238805#M43878</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am writing several proc freq procedures and am wanting to store them output table in a file. I am specifying that I only want the frequency and the column percentage. However, when I open the table that is created (newdata) the percentage stored is the total frequency percentage not the column percentage. What am I doing wrong? The results tab shows what I am wanting in the frequency table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my code.......&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=mydata;&lt;/P&gt;
&lt;P&gt;tables varA*varB/ out=newdata nopercent nocum norow;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the table "newdata" is showing&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;varA &amp;nbsp; &amp;nbsp;varB &amp;nbsp; &amp;nbsp;Frequency Count &amp;nbsp; &amp;nbsp; &amp;nbsp; Percent of Total Frequency&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;varA &amp;nbsp; &amp;nbsp;varB &amp;nbsp; &amp;nbsp;Frequency Count &amp;nbsp; &amp;nbsp; &amp;nbsp; Column Percentage&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 23:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/238805#M43878</guid>
      <dc:creator>BStats</dc:creator>
      <dc:date>2015-12-10T23:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Storing Proc Freq Data in a table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/238806#M43879</link>
      <description>&lt;P&gt;You need to add OUTPCT to add the pct columns to the output data set, check the docs for details.&lt;/P&gt;
&lt;P&gt;This is a bit of a roundabout way to get what you want, but easy enough. Someone else&amp;nbsp;may have a better answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.class;
table age*sex/out=want(drop=pct_row) outpct norow nocum;
run;

proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&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;</description>
      <pubDate>Thu, 10 Dec 2015 23:33:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/238806#M43879</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-10T23:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Storing Proc Freq Data in a table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/238808#M43880</link>
      <description>&lt;P&gt;This drops the row percentage. Thank you. How do I also get it to drop the percentage of frequency total? I tried adding pct_tabl but it did not work&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(drop=pct_row, pct_tabl)&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 23:40:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/238808#M43880</guid>
      <dc:creator>BStats</dc:creator>
      <dc:date>2015-12-10T23:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: Storing Proc Freq Data in a table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/238817#M43885</link>
      <description>&lt;P&gt;The variable name holding the total percent is PERCENT:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(drop=percent)&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 01:05:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/238817#M43885</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-12-11T01:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Storing Proc Freq Data in a table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/238818#M43886</link>
      <description>&lt;P&gt;Change the drop statement to reflect the variables you want to drop, they are space separated, not comma delimited.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;drop&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;pct_row percent&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Dec 2015 01:55:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/238818#M43886</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-11T01:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Storing Proc Freq Data in a table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/238919#M43918</link>
      <description>&lt;P&gt;If you want to use Proc Freq to generate multiple output sets from a single input dataset use multiple TABLE statements. Each table statement will only build one output data set.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 15:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/238919#M43918</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-12-11T15:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Storing Proc Freq Data in a table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/239364#M44017</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2015 16:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-Proc-Freq-Data-in-a-table/m-p/239364#M44017</guid>
      <dc:creator>BStats</dc:creator>
      <dc:date>2015-12-15T16:34:43Z</dc:date>
    </item>
  </channel>
</rss>

