You can also use PROC FREQ instead of PROC MEANS to obtain a bar chart that shows the top N…