<?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: PROC FREQ help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-help/m-p/521779#M141590</link>
    <description>&lt;P&gt;Yes you can do this with proc freq.&amp;nbsp; However proc freq produces a PERCENT variable that generates the number 20 to represent twenty percent, NOT the number 0.2.&amp;nbsp;&amp;nbsp; The problem is that SAS has a percent. format that shows .2 as 20%, but has none to show 20 as 20%.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can make your own format if you like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
  picture pct low-high='009%';
run;

proc freq noprint data=company;
	tables  co_name*name/out=work.company2 (drop=count);
	weight totalcontacts;
	format percent pct.;
run;
proc print data=company2;run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 16 Dec 2018 08:07:58 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2018-12-16T08:07:58Z</dc:date>
    <item>
      <title>PROC FREQ help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-help/m-p/521772#M141587</link>
      <description>&lt;P&gt;Is it possible to do this with proc freq?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data company;
	length co_name $50.;
 	input co_name $ 1-14 name $ 16-18 totalcontacts; 
 	datalines;
AAA Ford - BMC Dan 8
AAA Ford - BMC Jan 6
AAA Ford - BMC Mar 1
AAA Ford - BMC Tom 5
;
run;

proc freq noprint data=company;
	tables  name*totalcontacts/out=work.company2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want the output to look like this:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New"&gt;AAA&lt;/FONT&gt; Ford - BMC Dan &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;40&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;AAA Ford - BMC Jan &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;30&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;AAA Ford - BMC Mar &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;AAA Ford - BMC Tom &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;25&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;%&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Thanks&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Dec 2018 04:31:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-help/m-p/521772#M141587</guid>
      <dc:creator>dan999</dc:creator>
      <dc:date>2018-12-16T04:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-help/m-p/521773#M141588</link>
      <description>&lt;P&gt;Very easy and straight forward in sql:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data company;
	length co_name $50.;
 	input co_name $ 1-14 name $ 16-18 totalcontacts; 
 	datalines;
AAA Ford - BMC Dan 8
AAA Ford - BMC Jan 6
AAA Ford - BMC Mar 1
AAA Ford - BMC Tom 5
;
run;
proc sql;
create table company2 as
select co_name,name, totalcontacts/sum(totalcontacts) as pct format=percent.
from company
group by  co_name;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Dec 2018 04:59:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-help/m-p/521773#M141588</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-12-16T04:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-help/m-p/521779#M141590</link>
      <description>&lt;P&gt;Yes you can do this with proc freq.&amp;nbsp; However proc freq produces a PERCENT variable that generates the number 20 to represent twenty percent, NOT the number 0.2.&amp;nbsp;&amp;nbsp; The problem is that SAS has a percent. format that shows .2 as 20%, but has none to show 20 as 20%.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can make your own format if you like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
  picture pct low-high='009%';
run;

proc freq noprint data=company;
	tables  co_name*name/out=work.company2 (drop=count);
	weight totalcontacts;
	format percent pct.;
run;
proc print data=company2;run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 16 Dec 2018 08:07:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-help/m-p/521779#M141590</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-12-16T08:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-help/m-p/521799#M141599</link>
      <description>&lt;P&gt;I know how to do it in SQL. I thought proc freq might be fewer steps and I'd learn something new. Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Dec 2018 16:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-help/m-p/521799#M141599</guid>
      <dc:creator>dan999</dc:creator>
      <dc:date>2018-12-16T16:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-help/m-p/521800#M141600</link>
      <description>&lt;P&gt;So that's how you do it. Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Dec 2018 16:05:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-help/m-p/521800#M141600</guid>
      <dc:creator>dan999</dc:creator>
      <dc:date>2018-12-16T16:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-help/m-p/521801#M141601</link>
      <description>&lt;P&gt;Sorry. Replied to wrong post. Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Dec 2018 16:08:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-help/m-p/521801#M141601</guid>
      <dc:creator>dan999</dc:creator>
      <dc:date>2018-12-16T16:08:02Z</dc:date>
    </item>
  </channel>
</rss>

