Using Drop C is the main trick here. What is does is it will drop that column when creating dataset. Try this Data ratings1; set ratings(drop = C); run; Ratings1 will have all variable apart from C. Retain C. What this statement does it, 1 it will not reinitialize value of C to missing on reading new observation, 2 remember value from previous obsevration. Try reading some sas paper for more on retain statement, it pretty powerful statement. put first.id last.id; well this statement is not needed, I was just trying out something. You can remove this statement and program will work just fine. Main purpose of put is in debugging, it will write/print values in log for reach observation.
... View more