Calculate the average of the two highest salaries for employees who have three salaries and average of
Question:
Calculate the average of the two highest salaries for employees who have three salaries and average of two salaries if they have only two salaries. Print the names of employees who have the highest average in their department. Also, print their averages, their department names, and the department averages.
here is the data
data mt; input Employee_id Name$ gender$ years dept$ salary01 salary02 salary03; cards; 1 Mitchell,Jane f 6 shoe 22450 23000 26600 2 Miller,Frances f 8 appliance . 32500 33000 3 Evans,Richard m 9 appliance 42900 43900 . 4 Fair,Suzanne f 3 clothing 29700 32900 34500 5 Meyers,Thomas m 5 appliance 33700 34400 37000 6 Rogers,Steven m 3 shoe 27000 27800 . 7 Anderson,Frank m 5 clothing 33000 35100 36000 10 Baxter,David m 2 shoe 23900 . 31300 11 Wood,Brenda f 3 clothing 33000 34000 35700 12 Wheeler,Vickie f 7 appliance 31500 33200 35600 13 Hancock,Sharon f 1 clothing 21000 . 22500 14 Looney,Roger m 10 appliance 42900 36200 37800 15 Fry,Marie f 6 clothing 29700 30500 31200 ; run;