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 Step | DATA step |
Featured Step Options and Statements | IF _N_=1 statement SET statement, POINT= and NOBS= options |
Related Technique | PROC 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. ...
Get Combining and Modifying SAS® Data Sets: Examples Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.