Try the GROUP option in PROC REPORT, which I think does it by default. In general, REPORT will provide you more options for customizing your output as desired.
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss. Register now and lock in 2025 pricing—just $495!