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.
The following example creates a data set named A. The EDIT statement opens the data set for editing. The DELETE statement marks several observations for deletion. As shown in FigureĀ 25.281, the observations are not removed and renumbered until the PURGE statement executes.
data a; do i=1 to 10; output; end; run; proc iml; edit a; pts = 3:8; delete point pts; list all; purge; list all;
Figure 25.281: Deleting and Purging Observations