return to PRS Technologies website
################################################################################
#
# Module: check_frx1.sh
#
# Description: Check for FRX errors
# This program will determine if any frx "temp" records
# exist that have not been successfully posted to the
# frl_tran_detail table
# If records exist, a notification email should be generated.
#
# Author: Peter R. Schmidt and Mary Ann Tracy
#
# Change Log
#
# Date Person Description
#
# 03/28/2002 Peter Schmidt Start program
#
################################################################################
#
# if [ $# != 2 ]
# then
# echo "Usage: check_frx1.sh"
# exit 1
# fi
#
################################################################################
if [ "x$INFORMIXDIR" = "x" ]
then
. /elite/custom/run.elite # Set the informix environment
fi
TMPFILE1=$DBTEMP/frx1.tmp
rm -f $TMPFILE1
###############################################################################
cnt=`ps -ef | grep fmspost | grep -v grep | wc -l`
if [ $cnt = 0 ]; then
fmspost.4ge 2>&1 > /dev/null
fi
sleep 300
###############################################################################
# FOR USE IN TESTING WHEN NO ERRORS CURRENTLY EXIST
# dbaccess son_db <<-EOF >/dev/null 2>&1
# unload to "$TMPFILE1" delimiter " "
# select FIRST 10 count(*)
# from frxint
# where prind!=0 and entry_date1;
# EOF
dbaccess son_db <<-EOF >/dev/null 2>&1
unload to "$TMPFILE1" delimiter " "
select count(*)
from frxint
where prind=0 and entry_date1;
EOF
if [ -s $TMPFILE1 ]
then
ERR_NUM=`tail -1 $TMPFILE1 | cut -d"." -f1`
ERR_NUM=`expr $ERR_NUM + 0`
echo "Warning: $ERR_NUM FRX records exist that have not been "
echo " successfully posted to the frl_tran_detail table."
echo
echo "Recommend FRX rebuild be run and frxint.prind be set to 1 where currently 0"
echo
fi
rm -f $TMPFILE1
################################################################################