Hi,
I am comparing the number of records in the .bad record from sql loader, if it is higher than the number passed in as an argument, the program should exit. However, I constantly receive the error "
0403-016 Cannot find or open the file.
" on the line with the if statement " elif [ $bad_record_count <= $error_limit ];
". The code is below and error_limit=$1
. Any help is appreciated.
if [[ $chksanret = 0 ]]; then
sqlldr CONTROL=$LOAD_HOME/lndcntl/mrkdwndly.ctl LOG=$LOAD_HOME/loadresults/mrkdnasapbar.log \
BAD=$LOAD_HOME/loadresults/mrkdnasapbaz.bad DATA=$LOAD_HOME/$fnamem \
USERID=$OSLDR ERRORS=999 DISCARD=$LOAD_HOME/loadresults/mrkdnasaptoss.dis \
DISCARDMAX=5 DIRECT=TRUE
retcode=`echo $?`
bad_record_count=$(< $LOAD_HOME/loadresults/mrkdnasapbaz.bad wc -l)
if [[ $retcode = 0 ]]
then
cp $LOAD_HOME/$fnamem $LOAD_HOME/ARCHIVE/LND_ASAP_PRCCHG_DYLY.txt_$DATE
elif [ $bad_record_count <= $error_limit ];
then
cp $LOAD_HOME/$fnamem $LOAD_HOME/ARCHIVE/LND_ASAP_PRCCHG_DYLY.txt_$DATE
else
exit 12
fi
else
exit $chksanret