Rick_SAS,
While ENDSAS was originally designed to be used in command-line mode, it is perfectly fine to use it in any SAS interface, but it is especially useful in SAS programs that run in batch mode. One can (interactively) run a selected portion of code in SAS interface, but in batch we don't have that luxury, while often need to stop/terminate SAS process/session when a certain condition occurs (for example, a source file does not exist). That is where ENDSAS global statement comes very handy. I describe such usage in the following blog posts:
How to conditionally stop SAS code execution and gracefully terminate SAS session
and
Adaptive SAS programming for the Software Development Life Cycle
NOTE: In some SAS docs, it is incorrectly stated that "ENDSAS is most useful in interactive or windowing sessions."
... View more