<?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: Save number of observations of so many files efficiently in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/583261#M13937</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32269"&gt;@daradanye&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you gotten the answer you want? If not, describe the issues you face.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Aug 2019 16:48:56 GMT</pubDate>
    <dc:creator>KachiM</dc:creator>
    <dc:date>2019-08-22T16:48:56Z</dc:date>
    <item>
      <title>Save number of observations of so many files efficiently</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/582956#M13906</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following question,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have datasets from a2007 to a2018 (12 years).&amp;nbsp; For each year, the data looks like this:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Firm&lt;/TD&gt;&lt;TD&gt;Plant&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I want to summarize how many unique firms/firm-plants combinations for each year and then aggregate them together.&amp;nbsp; What I would like is something like this:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Year&lt;/TD&gt;&lt;TD&gt;# of firms&lt;/TD&gt;&lt;TD&gt;# of plants&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2007&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2018&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;12&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know I can use proc means output to generate a dataset each year.&amp;nbsp; Are there any more efficient ways?&amp;nbsp; By the way, since the dataset of each year is quite large,&amp;nbsp; I tried to append all the years together,&amp;nbsp; But it is very slow and drags down my PC speed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will appreciate it very much if someone can help out here.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 19:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/582956#M13906</guid>
      <dc:creator>daradanye</dc:creator>
      <dc:date>2019-08-21T19:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Save number of observations of so many files efficiently</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/582959#M13907</link>
      <description>Create a view that appends all the data sets together and run a single proc means on that data set.</description>
      <pubDate>Wed, 21 Aug 2019 19:28:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/582959#M13907</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-21T19:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Save number of observations of so many files efficiently</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/582961#M13908</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp; Is there any alternative way instead of appending datasets first?&amp;nbsp; The dataset is too large.&amp;nbsp; It takes a lot of to append and run in aggregate. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 19:34:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/582961#M13908</guid>
      <dc:creator>daradanye</dc:creator>
      <dc:date>2019-08-21T19:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Save number of observations of so many files efficiently</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/582965#M13909</link>
      <description>&lt;P&gt;That's why I said to create it as a VIEW, not a data set.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you try a VIEW? Then only proc means will be processing the whole data set.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data combined / view=combined;
set a2012-a2017 ;
run;

proc means data=combined;
class year;
var ....

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Aug 2019 19:44:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/582965#M13909</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-21T19:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Save number of observations of so many files efficiently</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/582977#M13910</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data combine;
	set a2007- a2018 indsname=source;
	year=compress(source,,'kd');
	no_firms=1;
	no_plants=1;
run;

proc means data= combine noprint nway;
	var  no_firms no_plants;
	class year;
	output out=want(drop = _:) sum=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Aug 2019 20:00:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/582977#M13910</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2019-08-21T20:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Save number of observations of so many files efficiently</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/583059#M13914</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32269"&gt;@daradanye&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Reeza,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp; Is there any alternative way instead of appending datasets first?&amp;nbsp; The dataset is too large.&amp;nbsp; It takes a lot of to append and run in aggregate. Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To large? How many obs do you have per dataset? Can you post the proc means you are using? Executing proc means for each dataset and appending the results could solve the performance issue.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 05:46:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/583059#M13914</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-08-22T05:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Save number of observations of so many files efficiently</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/583261#M13937</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32269"&gt;@daradanye&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you gotten the answer you want? If not, describe the issues you face.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 16:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/583261#M13937</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2019-08-22T16:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Save number of observations of so many files efficiently</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/583272#M13938</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32269"&gt;@daradanye&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution given by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/223452"&gt;@r_behata&lt;/a&gt;&amp;nbsp;gives same number for no_firms and no_plants as I have tested. The distinct number of firms within a Data Set must be less than or equal to the number of observations. Have I missed anything here?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 17:02:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Save-number-of-observations-of-so-many-files-efficiently/m-p/583272#M13938</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2019-08-22T17:02:33Z</dc:date>
    </item>
  </channel>
</rss>

