BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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?
2 REPLIES 2
Doc_Duke
Rhodochrosite | Level 12
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.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 592 views
  • 0 likes
  • 3 in conversation