ARCHIVED: In SAS, how do I remove observations?
To remove observations in SAS, you can use the
statement in a
DATA step. Suppose you want to exclude all
observations whose scores are greater than 100. Consider the following
DATA new; SET old; IF score <= 100; RUN;
DATA step reads the data set
and then removes all observations that do not meet the condition specified
IF statement. The result is stored in the data set
You can also use the
IF statement in different ways; the
IF statements are equivalent to the one listed
IF score <= 100 THEN OUTPUT; IF score > 100 THEN DELETE;
If you have questions about using statistical and mathematical software at Indiana University, email UITS Research Analytics. Research Analytics is located on the IU Bloomington campus at Woodburn Hall 200, and is open for consultation by appointment Monday-Friday 9am-5pm.
This is document affu in the Knowledge Base.
Last modified on 2015-06-26.
- Fill out this form to submit your issue to the UITS Support Center.
- Please note that you must be affiliated with Indiana University to receive support.
- All fields are required.