All Forums Tools
Susan 11 posts Joined 12/08
16 Jan 2009
How to return BTEQ and Fastload error codes to Unix

I am running fastload scripts and BTEQ scripts from a UNIX shell script. Everything was going fine until I inserted a test to make sure there was a return code of 0. My fastload script, in the fastload output, showed a return code of 0 but Unix is picking up 1. My BTEQ script is, deliberately, falling over with a return code of 8 but is returning 0 to Unix. How can I make BTEQ and Fastload pass their return codes to UNIX?This is the part of my shell script that is picking up a 1 from a complete OK fastload script fastload < $vScriptName if (($? != 0)) echo 'error ' $? ' in fastload script' then vErrorText="script $vScriptNameSuffix failed" ShowError fiHere is the end of the output that shows 0 is the return code but 1 is coming back to UNIX. . Highest return code encountered = '0'.**** 16:42:22 FDL4818 FastLoad Terminatederror 1 in fastload scriptError: script FLOAD_DIM_BRANCH.txt failedMany thanks for any help,Susan

j355ga 100 posts Joined 12/05
17 Jan 2009

Check you logic the if then fi should enclose the fail messagefastload<xif (($? != 0))then echo failelse echo okfi

Jeff

19 Jan 2009

bteq << EOF .logon $SERV/$USER,$PASS database $DBN; .RUN FILE=$SDIR/A.txt; .logoff .quitEOF#****** Check for Return code ********# if [[ $rc != 0 ]] then exit $rc fi

Susan 11 posts Joined 12/08
19 Jan 2009

Thanks for both responses - apologies for my basic error - penalties of trying to do something too quickly.Regards,Susan

You must sign in to leave a comment.