Help using Base SAS procedures

Remove deleted obs from table

Reply
Contributor
Posts: 42

Remove deleted obs from table

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

Frequent Contributor
Posts: 82

Remove deleted obs from table

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).

PROC Star
Posts: 7,356

Re: Remove deleted obs from table

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

Contributor
Posts: 42

Remove deleted obs from table

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. 

Contributor
Posts: 42

Remove deleted obs from table

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

Ask a Question
Discussion stats
  • 4 replies
  • 134 views
  • 0 likes
  • 3 in conversation