And what is the question? You have code posted above, some of which you have marked as the answer to your question. If this does not fill your needs then open a new topic, post test data in the form of a datastep, post example output, and what you have tried.
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!