O'Reilly logo

Combining and Modifying SAS® Data Sets: Examples Second Edition by Michele M. Burlew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Example 8.1 Performing a Simple Subset

Goal

Create a subset of a SAS data set efficiently by selecting for processing only observations that meet a particular condition.

Example Features

Featured StepDATA step
Featured Step Options and StatementsWHERE statement
Related TechniquePROC SQL, WHERE clause
A Closer LookComparing the WHERE Statement in the DATA Step and the Subsetting IF Statement

Input Data Set

Data set CELLPHONES contains the support records for one day. Only the first 25 of 10,000 observations are shown.

                           CELLPHONES

  Obs   callhour   calllength     status       reason 1 00 10 Resolved Text Msg Help 2 00 2 Transferred Other Feature Help 3 01 3 Resolved Start Service 4 01 2 Resolved Other 5 01 4 Resolved Voice Mail Help 6 01 4 Resolved Billing Change ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required