Yes. SAS will set the error code when it exits, which you can then test.
In this example the error code was set to 5:
1? options errorabend;
2? data x.y.z; run;
2 data x.y.z; run;
-----
211
ERROR 211-185: Invalid data set name.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
ERROR: SAS ended due to errors.
You specified: OPTIONS ERRORABEND;.
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
real time 17.24 seconds
cpu time 0.04 seconds
>echo $?
5
Or you can use the ABORT statement with the RETURN option and return an error number you want.
Example:
>sas -noautoexec -nodms
...
NOTE: SAS initialization used:
real time 0.06 seconds
cpu time 0.03 seconds
1? data _null_; abort return 27; run;
ERROR: Execution terminated by an ABORT statement at line 1 column 14,
it specified the RETURN option.
_ERROR_=1 _N_=1
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
real time 13.24 seconds
cpu time 0.03 seconds
>echo $?
27
Now you just need to ask the makers of that other software how to detect the return code of a program you used it to run.
... View more