<?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 for a large data set in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26004#M5915</link>
    <description>Hi.&lt;BR /&gt;
You can try to create an index for this vaiable.&lt;BR /&gt;
I am not sure it can work.Just a suggestion.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
    <pubDate>Thu, 10 Mar 2011 05:34:04 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2011-03-10T05:34:04Z</dc:date>
    <item>
      <title>PROC FREQ for a large data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26003#M5914</link>
      <description>Hi I have a huge data set 915K records for which I want to do a PROC FREQ on just one field which is 90 bytes long.  I seem to be running out space for some reason. Can any offer any help/suggestions on how I might get around this.  &lt;BR /&gt;
&lt;BR /&gt;
NOTE: The SAS System stopped processing this step because of insufficient memory.&lt;BR /&gt;
I am trying to output this to another dataset with a OUT statement still no joy.&lt;BR /&gt;
&lt;BR /&gt;
thanks so much in advance.</description>
      <pubDate>Thu, 10 Mar 2011 03:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26003#M5914</guid>
      <dc:creator>yaswoman</dc:creator>
      <dc:date>2011-03-10T03:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ for a large data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26004#M5915</link>
      <description>Hi.&lt;BR /&gt;
You can try to create an index for this vaiable.&lt;BR /&gt;
I am not sure it can work.Just a suggestion.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Thu, 10 Mar 2011 05:34:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26004#M5915</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-03-10T05:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ for a large data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26005#M5916</link>
      <description>thanks. Can you please explain further. Not sure if I know how to do that.&lt;BR /&gt;
&lt;BR /&gt;
thanks.</description>
      <pubDate>Thu, 10 Mar 2011 12:09:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26005#M5916</guid>
      <dc:creator>yaswoman</dc:creator>
      <dc:date>2011-03-10T12:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ for a large data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26006#M5917</link>
      <description>There are a number of options that you could try.&lt;BR /&gt;
&lt;BR /&gt;
1) sort the data set by your variable of interest.  then use PROC SUMMARY with just a by statement and no var statement.  PROC SUMMARY will output a field called _freq_ in the output dataset.&lt;BR /&gt;
&lt;BR /&gt;
2) use proc sql with a group by and see what happens.&lt;BR /&gt;
&lt;BR /&gt;
Darryl</description>
      <pubDate>Thu, 10 Mar 2011 13:50:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26006#M5917</guid>
      <dc:creator>darrylovia</dc:creator>
      <dc:date>2011-03-10T13:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ for a large data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26007#M5918</link>
      <description>Darryl's response should work.&lt;BR /&gt;
&lt;BR /&gt;
The reason that you were running out of space is that the memory needs of FREQ are a function of the number of DISTINCT values of the variable times it's length (the reference manual should have the exact formula).  With that many observations and a text field, you'll could have lots.&lt;BR /&gt;
&lt;BR /&gt;
The SORTing and SUMMARY are disk space dependent.  SQL is a mix, as it tries to put as much in memory as it can and then relies on disk.  Both will take longer than FREQ would have done if you had enough memory.&lt;BR /&gt;
&lt;BR /&gt;
Doc Muhlbaier&lt;BR /&gt;
Duke</description>
      <pubDate>Thu, 10 Mar 2011 14:26:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26007#M5918</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-03-10T14:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ for a large data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26008#M5919</link>
      <description>thank you both Darryl and Duke. Will try your suggestions.&lt;BR /&gt;
&lt;BR /&gt;
Much appreciated.</description>
      <pubDate>Thu, 10 Mar 2011 14:42:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26008#M5919</guid>
      <dc:creator>yaswoman</dc:creator>
      <dc:date>2011-03-10T14:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ for a large data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26009#M5920</link>
      <description>This is basically the same idea as suggest already.&lt;BR /&gt;
&lt;BR /&gt;
I don't know how long it would take to sort the data.  You might want to do sort the data in groups then combine and count.  Be sure to keep only the variable that needs counting.  Should save a lot ot time if the data set has lots of variables.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sort data=sashelp.shoes(keep=Subsidiary firstobs=1 obs=200) out=bin1;&lt;BR /&gt;
   by Subsidiary;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc sort data=sashelp.shoes(keep=Subsidiary firstobs=201 obs=max) out=bin2;&lt;BR /&gt;
   by Subsidiary;&lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
data freq;&lt;BR /&gt;
   do Frequency=1 by 1 until(last.Subsidiary);&lt;BR /&gt;
      set bin1 bin2;&lt;BR /&gt;
      by Subsidiary;&lt;BR /&gt;
      end;&lt;BR /&gt;
   CumulativeFrequency + Frequency;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 11 Mar 2011 13:37:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-FREQ-for-a-large-data-set/m-p/26009#M5920</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-03-11T13:37:53Z</dc:date>
    </item>
  </channel>
</rss>

