Once upon a time (5.17) running SAS would mean using batch scripts.
As running programs while you are not there is an important aspect of automating all kind of things I have always been wondered the focus on interactive usage as the only holy grail.

SAS is behaving different with a lot of small attention points for interactive or batch usage.
The only real reason is that running in batch is requiring thinking on all kind of error or warining conditions as nobody is there to decide what to do.

Using the SYSCC SAS macro for informing the OS script of the SAS code condition is a important step to do.
Remembering the CC stands for Condition Code of mainframe job step processing. In Unix (linux) it is a value between 0-255 The Sh script can validate is by using $?
The common convention is value: 0 all is ok, not zero than something is badly wrong.