In reply to Anne Aubrun.

Thank you, Anne! I am glad you learned something "new" :) . By the way, I have a whole blog post on using the ENDSAS statement, take a look:
→ How to conditionally stop SAS code execution and gracefully terminate SAS session.
Best regards!