<?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: apply proc freq on a variable in a large dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/apply-proc-freq-on-a-variable-in-a-large-dataset/m-p/799871#M314567</link>
    <description>&lt;P&gt;In addition to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt; for variables that may have lots of values you might consider the NOPRINT option on the Proc Freq statement along with the OUT= to create a data set. No reason to create two output tables if not needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2022 14:44:49 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-03-03T14:44:49Z</dc:date>
    <item>
      <title>apply proc freq on a variable in a large dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/apply-proc-freq-on-a-variable-in-a-large-dataset/m-p/799760#M314502</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I see that when I apply proc freq on a variable in a large dataset, the result gets truncated to scientific notation. Eg. for the below on a dataset of 35 Million records&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Proc freq data=sales;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tables year_month ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Run;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Gives me the frequencies like follows&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;TABLE width="159"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;202108&lt;/TD&gt;
&lt;TD width="95"&gt;1.06E+08&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;202109&lt;/TD&gt;
&lt;TD&gt;1.05E+08&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;202110&lt;/TD&gt;
&lt;TD&gt;1.02E+08&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;202111&lt;/TD&gt;
&lt;TD&gt;1.04E+08&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;202112&lt;/TD&gt;
&lt;TD&gt;1.01E+08&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;202201&lt;/TD&gt;
&lt;TD&gt;98690488&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;202202&lt;/TD&gt;
&lt;TD&gt;81642710&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want the numbers to appear completely with a comma separator.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried using formats (best12. and comma12.) in the tables statement&amp;nbsp;but to no avail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Help appreciated! how can i use PROC Template.? not able to figure&amp;nbsp;out&amp;nbsp;&lt;/SPAN&gt;syntax&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 07:14:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/apply-proc-freq-on-a-variable-in-a-large-dataset/m-p/799760#M314502</guid>
      <dc:creator>librasonali</dc:creator>
      <dc:date>2022-03-03T07:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: apply proc freq on a variable in a large dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/apply-proc-freq-on-a-variable-in-a-large-dataset/m-p/799766#M314508</link>
      <description>&lt;P&gt;Use the FORMAT option in the TABLES statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sales;
tables year_month / format=20.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Mar 2022 07:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/apply-proc-freq-on-a-variable-in-a-large-dataset/m-p/799766#M314508</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-03T07:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: apply proc freq on a variable in a large dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/apply-proc-freq-on-a-variable-in-a-large-dataset/m-p/799788#M314522</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/345043"&gt;@librasonali&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would write the PROC FREQ output to a dataset (&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/procstat/procstat_freq_syntax08.htm#procstat.freq.freqout" target="_blank" rel="noopener"&gt;OUT= option&lt;/A&gt; of the TABLES statement) and then use PROC PRINT or PROC REPORT to display the frequencies (and percentages if needed) in the desired format. Here's an example including the cumulative frequencies and percentages (via the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/procstat/procstat_freq_syntax08.htm#procstat.freq.freqoutcum" target="_blank" rel="noopener"&gt;OUTCUM option&lt;/A&gt;)&lt;FONT face="helvetica"&gt;:&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.heart;
tables smoking_status / out=want outcum missing;
run;

proc print data=want;
format count cum_freq comma12.
       percent cum_pct 6.2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="helvetica"&gt;(The &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/procstat/procstat_freq_syntax08.htm#procstat.freq.freqformat" target="_blank" rel="noopener"&gt;FORMAT= option&lt;/A&gt; of the TABLES statement applies to &lt;EM&gt;cross&lt;/EM&gt;tabulations.)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 09:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/apply-proc-freq-on-a-variable-in-a-large-dataset/m-p/799788#M314522</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-03-03T09:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: apply proc freq on a variable in a large dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/apply-proc-freq-on-a-variable-in-a-large-dataset/m-p/799871#M314567</link>
      <description>&lt;P&gt;In addition to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt; for variables that may have lots of values you might consider the NOPRINT option on the Proc Freq statement along with the OUT= to create a data set. No reason to create two output tables if not needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 14:44:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/apply-proc-freq-on-a-variable-in-a-large-dataset/m-p/799871#M314567</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-03-03T14:44:49Z</dc:date>
    </item>
  </channel>
</rss>

