Re: Executing teradata procedures in unix shell scripts
You can configure your BTEQ script to exit whenever an error level occurs that is above a given threshold. the .SET MAXERROR statement achieves this. Alternatively, you can check the error level after each call to a stored procedure and use conditional logic to either continue or exit. But all that you'll be able to pass back to the shell script is (I believe) a single byte standard return code value. So no SQL error codes.
If you need to have the SQL error codes available in UNIX, you can export the error codes to a log file or store them in a database log table and then extract the contents of said table.