BTEQ Error Handling in Unix

General
Enthusiast

BTEQ Error Handling in Unix

Hi ,

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

3 REPLIES
Enthusiast

Re: BTEQ Error Handling in Unix

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:

export rc=$?

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.

Enthusiast

Re: BTEQ Error Handling in Unix

Yes this is what exaclty I had tried.But for some reason BTEQ is not returning anything.

Re: BTEQ Error Handling in Unix

Friends,

Please try redirecting the script output to a log file

Eg:$Script_Dir/Test_BTEQ_Code.sh > $Script_Dir/$Logs/Test_BTEQ_Code.log

Aravind