I need the last 5 teachers' names concatenated for each course_code. At the end, I'd only have one record for each course_code that would contain course_code and teachers_names.
I thought I'd use PROC RANK to get the last 5 records for each course_code (using begin_date field). Now, how do I concatenate the names? Is there any other way of doing the whole thing more efficiently?
Dateset: sasuser.schedule
Course_Code Location Begin_Date Teacher
C001 Seattle 23-Oct-00 Hallis, Dr. George
C002 Dallas 4-Dec-00 Wickam, Dr. Alice
C003 Boston 8-Jan-01 Forest, Mr. Peter
C004 Seattle 22-Jan-01 Tally, Ms. Julia
C005 Dallas 26-Feb-01 Hallis, Dr. George
C006 Boston 2-Apr-01 Berthan, Ms. Judy
C001 Dallas 21-May-01 Hallis, Dr. George