Previous Page | Next Page

Language Reference

PURGE Statement

PURGE ;

The PURGE data processing statement is used to remove observations marked for deletion and to renumber the remaining observations. This closes the gaps created by deleted records. Execution of this statement can be time-consuming because it involves rewriting the entire data set.

Caution:Any indexes associated with the data set are lost after a purge.

When you quit PROC IML, observations marked for deletion are not automatically purged.

In the example that follows, a data set named A is created. Then, you begin PROC IML and edit A. You delete the fifth observation, list the data set, and issue a PURGE statement to delete the fifth observation and renumber the remaining observations.

   data a;
      do i=1 to 10;
         output;
      end;
   run;

   proc iml;
      edit a;
      delete point 5;
      list all;
      purge;
      list all;
Previous Page | Next Page | Top of Page