Example 5.2 Adding Values from the Last Observation in a Data Set to All Observations in a Data Set


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.


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

Get Combining and Modifying SAS® Data Sets: Examples Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.