I have BTEQ with error handling in it which works fine in unix. I have used
.QUIT ERRORCODE for when BTEQ fails,However I do not get this errorcode in my unix shell script form which I call BTEQ.
How do I capture this errorcode/return code
You can define a variable to capture the return code of any command/job executed just after calling it.
You can add below code after calling bteq:
here rc captures the return code of bteq. If the errorcode you mentioned in bteq is 23 then variable rc contains 23. With this you can just write a If condition whether to quit the entire process ot just display some message.
Please try redirecting the script output to a log file
Eg:$Script_Dir/Test_BTEQ_Code.sh > $Script_Dir/$Logs/Test_BTEQ_Code.log