Dear mklangley, Thanks for your continued attention and help. Today I pasted your codes into my SAS EG, it worked! I got output of four lines, each row is a unique sch_id. The new columns are group_color combined for the sum, This is exactly what I am looking for. Thank you so much. Next I will modify my codes according to my real world data structure and apply them to my dataset to see if I can get them out as desired. Thank you everyone who read and gave your help in many ways. Best wishes, see you around. Peter
... View more