In reply to Anne Aubrun.

I followed up with SAS Technical Support, and they told me that "this was a known defect that has been fixed in SAS Studio for Viya 3.5". With this fix, ENDSAS stops further processing (without generating any message) but does not terminate/exit the session in SAS Studio. I also requested to update the documentation for the ENDSAS statement to reflect this behavior.

Once again, thank you, Anne, for bringing this to my attention.