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 5.2 Adding Values from the Last Observation in a Data Set to All Observations in a Data Set

Goal

Combine values from the last observation in one data set to all observations in another data set.

Example Features

Featured StepDATA step
Featured Step Options and StatementsIF _N_=1 statement SET statement, POINT= and NOBS= options
Related TechniquePROC SQL, Cartesian product, subquery, MAX function

Input Data Sets

Data set MANAGERS contains a list of managers for a group over time.

              MANAGERS

Obs      mgrdate    manager
 1    07/12/2005  Butler, RE
 2    01/15/2006  Wright, MV
 3    11/15/2006  Freeman, OG
 4    06/10/2007  Jenkins, UI
 5    12/03/2007  Phillips, OB
 6    01/15/2008  Myers, SC
 7    05/15/2008  Brown, HU

Data set EMPLIST contains a list of employees in the group. ...

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