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.5 Accessing a Specific Number of Observations from the Beginning and End of a Data Set

Goal

Process a specific number of observations at the beginning and end of a data set. Efficiently access the observations by not reading the entire data set. If the total number of observations in the data set is less than the sum of observations to access, process the entire data set.

Example Features

Featured StepDATA step
Featured Step Options and StatementsDirect access, SET statement, NOBS= and POINT= options

Input Data Set

Data set BLOODPRESSURE contains 20 blood pressure measurements.

                         BLOODPRESSURE

        Obs    bptime    systolic    diastolic    pulse 1 8:20 160 90 99 2 8:22 171 92 103 3 8:24 158 88 102 4 8:30 155 90 93 5 8:43 144 88 90 6 8:51 145 82 88 ...

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