In my shell script I am using BTEQ, which is doing Fastexport. I will get two return codes. One from BTEQ and another from Fast Export. I want to use the Fast Export Return code in my Unix script to do the further processing.
I found that return codes automatically stores in $? and we can use that. but it is not working.
If RC !=0 then
do not merge the files
merge the files
Anyone??? Is this the right place to ask this question or should I ask this in any UNIX forum?
Hi, I think you will find in unix / linux forums more valuable answers.
But you need to do something like
bteq < your_code.btq >>$LOG 2>&1
echo "STATUS: $RC" >>$LOG
if [ $RC != 0 ]; then
echo "End with ERROR. ($RC)" >>$LOG