Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

In SAS, how do I remove observations?

To remove observations in SAS, you can use the IF statement in a DATA step. Suppose you want to exclude all observations whose scores are greater than 100. Consider the following example:

DATA new; SET old; IF score <= 100; RUN;

The above DATA step reads the data set old, and then removes all observations that do not meet the condition specified in the IF statement. The result is stored in the data set new.

You can also use the IF statement in different ways; the following IF statements are equivalent to the one listed above:

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 (formerly known as the Stat/Math Center). Research Analytics is located on the IU Bloomington campus at Woodburn Hall 200, and is open for consultation by appointment Monday-Friday 9am-5pm. For more, visit Research Analytics on the web, or call 812-855-4724 (IUB) or 317-278-4740 (IUPUI).

This is document affu in domain all.
Last modified on January 25, 2013.

I need help with a computing problem

  • 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.



Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

I have a comment for the Knowledge Base

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.