Desktop productivity for business analysts and programmers

8 GB SAS dataset for just one observation???!!!!

Reply
N/A
Posts: 0

8 GB SAS dataset for just one observation???!!!!

Hi,

I had 1 million observations in a SAS dataset and the size of it was 8 GB. Later on , I deleted all observations except one . Even then the size of the dataset was still 8 GB. This dataset is used in a SAS DI studio job, and because of this size problem the job fails.
Has anybody faced anything like this?
Trusted Advisor
Posts: 2,114

Re: 8 GB SAS dataset for just one observation???!!!!

If you do a delete in place, SAS does not free the space. Make a copy and just select one observation and it will adjust the space:

DATA new; SET old; IF _N_=1; RUN;
or even
DATA perm.million; SET perm.million; IF _n_=1; RUN;

would adjust the disk space size.
Super Contributor
Super Contributor
Posts: 3,174

Re: 8 GB SAS dataset for just one observation???!!!!

It is true that the entire SAS data library's disk space usage is not reduced when a SAS member is reduced in size, however SAS does a fine job managing the space within the data library - much better than back in the day of SAS 5.18 and earlier (82.3 and 79.6). Review the PROC CONTENTS or DATASETS output for the data library and each member for details - sample SAS code to demonstrate is provided below.

And, so, the only way to reclaim the disk space (and reduce the SAS-used high watermark) is to copy out the entire library, delete it, and copy it back as a new allocation.

Scott Barry
SBBWorks, Inc.

options compress=no;
data x;
retain a1-a100 'xxxxxxxxxxxxxxxxxxxxx';
do i=1 to 1e6;
output;
end;
run;
proc datasets lib=work;
run;
data x;
set x;
output;
stop;
run;
proc datasets lib=work;
run;
Ask a Question
Discussion stats
  • 2 replies
  • 125 views
  • 0 likes
  • 3 in conversation