Far22
asked on
how to fix error: unable to load local category
Hi experts
i have a shell script that when i run it through cron i got error: can't load the local category.
the line is:
dosql " update txout_820 set flag821 = 'W' where edifname= '04050055.23'"
and dosql doesnt run.
everything else is working fine except dosql.
could you please help me with that.
sorry if i post in the wrong category.
thanks a lot. pls pls help me with that.
this is my script:
#!/bin/sh
# This script will copy Bell Canada EDI file to AS2 server
########################## ##
#####
export DBPATH=/swdbase/database
export DBTEMP=/swdbase/tmp
export PATH=/usr/kerberos/bin:/us r/local/bi n:/bin:/us r/bin:/usr /X11R6/bin :/informix /bin:/usr2 /reporting /bin:/usr2 /reporting /cvs-bprpt /script:/u sr4/edi/ed i_script
#####
THELOG=/usr2/logfile/edi_t rans.log
BIN=/usr4/edi/edi_script
mm=` date +%m`
dd=` date +%d`
#viewfile=/usr4/edi/edi_as 2_ready/vf
echo "------------------------- ---------- ---------- ---------" >> $THELOG
echo "`date +%m/%d/%y-%H:%M:%S` : edi autosend.as2 starting -----" >> $THELOG
echo " sending Bell Canada file to AS2 server " >> $THELOG
cd /usr4/edi/edi_as2_ready
echo $mm$dd
for edi_as2 in `ls`
do
echo $edi_as2
echo " `date ` - starting duplicate check" >> $THELOG
bellcdn=`$BIN/viewedi < $edi_as2 |grep 'BELLOACCTREC' |wc -l`
echo " size: $bellcdn "
if (test $bellcdn -gt 0) then
$BIN/autosend_edi_duplicat e_check.pl $edi_as2 >> $THELOG
result=$?
case "$result" in
0)
echo "$edi_as2 is NOT duplicated"
scp $edi_as2 esp@172.17.68.216:/var/usr 4/faran/sc p_as2_file / ### lexicom@clxp01as2.cucbc.co m:/opt/lex icom/outbo x/Bell/
echo "The following file sent out:" >> $THELOG
echo $edi_as2 >> $THELOG
#mv $edi_as2 /usr4/edi/edi_backup/ > /dev/null 2>&1
echo "update txout_820" >>$THELOG
dosql " update txout_820 set flag821 = 'W' where edifname= '04050055.23'"
;;
1)
echo "$edi_as2 is duplicated"
sendmon 1 " autosend.as2----$edi_as2 is duplicated, Please check"
##### mv $edi_as2 $EDIDIR/edi_hold
##### cp $edi_as2 $EDIDIR/edi_hold
echo $edi_as2 "has been moved to edi_hold "
echo "------------------------- ---------- -" >> $THELOG
echo "update txout_820" >>$THELOG
#dosql " update txout_820 set flag821 = 'N' where flag821 = 'C' and edifname = '$edi_as2' "
;;
2)
echo "not a 820 file"
echo "not 820 file" >> $THELOG
##### scp $edi_as2 esp@172.17.68.216:/var/usr 4/faran/sc p_as2_file / ### lexicom@clxp01as2.cucbc.co m:/opt/lex icom/outbo x/Bell/
##### mv $edi_as2 /usr4/edi/edi_backup/ > /dev/null 2>&1
##### cp mv $edi_as2 /usr4/edi/edi_backup/ > /dev/null 2>&1
;;
3)
echo "no record found in database" ;;
esac
echo "result : $result"
else
echo "No file to send." >> $THELOG
fi
done
echo "`date +%m/%d/%y-%H:%M:%S` : edi autosend.as2 ended -----" >> $THELOG
echo "------------------------- ---------- ---------- ---------" >> $THELOG
exit 0
i have a shell script that when i run it through cron i got error: can't load the local category.
the line is:
dosql " update txout_820 set flag821 = 'W' where edifname= '04050055.23'"
and dosql doesnt run.
everything else is working fine except dosql.
could you please help me with that.
sorry if i post in the wrong category.
thanks a lot. pls pls help me with that.
this is my script:
#!/bin/sh
# This script will copy Bell Canada EDI file to AS2 server
##########################
#####
export DBPATH=/swdbase/database
export DBTEMP=/swdbase/tmp
export PATH=/usr/kerberos/bin:/us
#####
THELOG=/usr2/logfile/edi_t
BIN=/usr4/edi/edi_script
mm=` date +%m`
dd=` date +%d`
#viewfile=/usr4/edi/edi_as
echo "-------------------------
echo "`date +%m/%d/%y-%H:%M:%S` : edi autosend.as2 starting -----" >> $THELOG
echo " sending Bell Canada file to AS2 server " >> $THELOG
cd /usr4/edi/edi_as2_ready
echo $mm$dd
for edi_as2 in `ls`
do
echo $edi_as2
echo " `date ` - starting duplicate check" >> $THELOG
bellcdn=`$BIN/viewedi < $edi_as2 |grep 'BELLOACCTREC' |wc -l`
echo " size: $bellcdn "
if (test $bellcdn -gt 0) then
$BIN/autosend_edi_duplicat
result=$?
case "$result" in
0)
echo "$edi_as2 is NOT duplicated"
scp $edi_as2 esp@172.17.68.216:/var/usr
echo "The following file sent out:" >> $THELOG
echo $edi_as2 >> $THELOG
#mv $edi_as2 /usr4/edi/edi_backup/ > /dev/null 2>&1
echo "update txout_820" >>$THELOG
dosql " update txout_820 set flag821 = 'W' where edifname= '04050055.23'"
;;
1)
echo "$edi_as2 is duplicated"
sendmon 1 " autosend.as2----$edi_as2 is duplicated, Please check"
##### mv $edi_as2 $EDIDIR/edi_hold
##### cp $edi_as2 $EDIDIR/edi_hold
echo $edi_as2 "has been moved to edi_hold "
echo "-------------------------
echo "update txout_820" >>$THELOG
#dosql " update txout_820 set flag821 = 'N' where flag821 = 'C' and edifname = '$edi_as2' "
;;
2)
echo "not a 820 file"
echo "not 820 file" >> $THELOG
##### scp $edi_as2 esp@172.17.68.216:/var/usr
##### mv $edi_as2 /usr4/edi/edi_backup/ > /dev/null 2>&1
##### cp mv $edi_as2 /usr4/edi/edi_backup/ > /dev/null 2>&1
;;
3)
echo "no record found in database" ;;
esac
echo "result : $result"
else
echo "No file to send." >> $THELOG
fi
done
echo "`date +%m/%d/%y-%H:%M:%S` : edi autosend.as2 ended -----" >> $THELOG
echo "-------------------------
exit 0
is dosql a perl program?
if so, could you show us the source code of dosql?
if so, could you show us the source code of dosql?
ASKER
dosql is a command of informix.
actually i found out that by typing "which dosql " in linux terminal.
and i found : /informix/bin
actually i found out that by typing "which dosql " in linux terminal.
and i found : /informix/bin
ASKER
i have informix/bin in my path.
i'm not sure but i think the problem is that when i run my script throiugh cron , i need explicitly set the variables in cron table.
does anybody know how to set environment explicitly in crontab?
thanks
i'm not sure but i think the problem is that when i run my script throiugh cron , i need explicitly set the variables in cron table.
does anybody know how to set environment explicitly in crontab?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks a lot for your quick response.
yah , it was environment problem and i export some variables . it's working fine now.
thanks
Far22
yah , it was environment problem and i export some variables . it's working fine now.
thanks
Far22
ASKER
-23101 Unable to load locale categories.