Without any data or seeing the code you've tried, it's hard to make much of a suggestion, but I would be tempted to use PROC REPORT and something like the program below.
cynthia
Catch up on SAS Innovate 2026
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.