Example 8.4 Separating the First Observation in a BY Group from the Other Observations in the BY Group
Write the first observation in a BY group to one data set. Write the other observations in the BY group to a second data set.
|Featured Step||DATA step|
|Featured Step Options and Statements||FIRST.variable and LAST.variable temporary variables|
|Related Technique||PROC SORT, DUPOUT=, NODUPKEY, and OUT= options|
Input Data Set
Data set TRADE_ASSN contains membership records for four members of a trade association. Each observation stores the membership information for one company for one year. Note that three of the four companies have more than one observation and that one company, Surname Associates, has only one observation.