Selecting Observations for a New SAS Data Set
Deleting Observations Based on a Condition
There are two ways to select specific observations in a SAS data set when you create a new SAS data set:
Delete the observations that do not meet a condition, keeping only the ones that you want.
Accept only the observations that meet a condition.
To delete an observation, first identify it with an IF condition, and then use a DELETE statement in the THEN clause:
IF condition THEN DELETE;
Processing the DELETE statement for an observation causes SAS to return immediately to the beginning of the DATA step for a new observation without writing the current observation to the output DATA set. The DELETE statement does not include the observation ...