BookmarkSubscribeRSS Feed
jcbell
Obsidian | Level 7

I'm searching for a efficient way to remove deleted obs from a SAS table.  I know I can write a table on itself or copy the table to remove the deleted observations, but my tables in question are rather large.  I'm curious if there are any other techniques available to avoid having to write out all of the obs.  I thought proc datasets might clean up the table, but I don't see anything in the documentation that performs this action.

Any ideas?


Thanks,

john

4 REPLIES 4
ieva
Pyrite | Level 9

What do you mean by "deleted observations"?

I think you will need to open and process data at least once anyway to define which observations you want to delete, right? So you could try to do this in the most efficient way (for example, using WHERE statement).

art297
Opal | Level 21

Are you looking for the purge statement?  Unfortunately, I think it is only available in SAS/IML

jcbell
Obsidian | Level 7

Yes - Something like a purge.  I have large datasets that are accumulating deleted observations (25M).  I can always overwrite the table, but I wanted to see if anyone had a better suggestion (more efficient).  I suppose I can take a look at IML. 

jcbell
Obsidian | Level 7

For anyone else with a similar issue -

IML does work - but isn't as efficient as using a data step and over-writing the table.

A purge statement in proc datasets seems like a sensible option to add.....

Thanks everyone,

john

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1134 views
  • 0 likes
  • 3 in conversation