Link to home
Start Free TrialLog in
Avatar of Far22
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:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/informix/bin:/usr2/reporting/bin:/usr2/reporting/cvs-bprpt/script:/usr4/edi/edi_script
#####
THELOG=/usr2/logfile/edi_trans.log
BIN=/usr4/edi/edi_script
mm=` date +%m`
dd=` date +%d`
#viewfile=/usr4/edi/edi_as2_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_duplicate_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/usr4/faran/scp_as2_file/ ### lexicom@clxp01as2.cucbc.com:/opt/lexicom/outbox/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/usr4/faran/scp_as2_file/   ### lexicom@clxp01as2.cucbc.com:/opt/lexicom/outbox/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

Avatar of Far22
Far22

ASKER

actually this is the error message:
-23101 Unable to load locale categories.
Avatar of ozo
is dosql a perl program?
if so, could you show us the source code of dosql?
Avatar of Far22

ASKER

dosql is a command of informix.
actually i found out that by typing "which dosql " in linux terminal.

and i found : /informix/bin
Avatar of Far22

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
ASKER CERTIFIED SOLUTION
Avatar of Adam314
Adam314

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Far22

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