Using BY-Group Processing
Finding the First and Last Observations in a Group
data temp; set salary; by dept; run;
-
the data sets that are listed in the SET statement must be sorted by the values of the BY variable(s), or they must have an appropriate index.
-
the DATA step creates two temporary variables for each BY variable. One is named FIRST.variable, where variable is the name of the BY variable, and the other is named LAST.variable. Their ...
Get SAS Certification Prep Guide: Base Programming for SAS 9, Third 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.