Language Reference

PURGE Statement

removes observations marked for deletion and renumbers records

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.

IML does not do an automatic purge for you at quit time.

In the example that follows, a data set named A is created. Then, you begin an IML session 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