return to PRS Technologies website
################################################################################
#
# Module: fix_winoutstat5.sh
#
# Description:
# Delete winoutstat records that point to Unix files that do not exist
#
# Author: Peter R. Schmidt
#
# Change Log
#
# Date Person Description
#
# 03/28/2002 Peter Schmidt Start program
#
################################################################################
. /elite/custom/run.elite
echo "Searching $REPORTDIR"
rm -f unix_files1.unl
rm -f missing_in_elite.unl
rm -f delete_rpt2.out
rm -f delete_rpt1.out
rm -f delete_idx1.out
dbaccess son_db <<-EOF
set isolation to dirty read;
!echo "Unload winoutstat (used later to determine if Unix files are missing)"
unload to "winoutstat.unl"
select *
from winoutstat
where wofile IS NOT NULL
order by wodate0 desc
EOF
echo
echo "Checking files..."
echo "(where file is in Elite winoutstat, but not in Unix)"
echo
IFS="|"
while read WOINDEX WOUSER WOUSER1 WOREPORT WOTITLE WOFILE WODATE0 WOTIME0 WOSTAT1 WODESC1 WODATE1 WOTIME1 WOSTAT2 WODESC2 WODATE2 WOTIME2 WOFILE2 WOPID
do
if [ ! -f $WOFILE ]; then
echo "$WOINDEX $WODATE0 $WOUSER $WOFILE" >> delete_rpt1.out
echo "${WOINDEX}|" >> delete_idx1.out
fi
done < winoutstat.unl
echo
echo "Press to see files in Elite winoutstat, but not in Unix."
echo "(File is delete_rpt1.out)"
read answer
echo
pg delete_rpt1.out
echo
echo "Completed"
################################################################################