• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1301
  • Last Modified:

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

0
Far22
Asked:
Far22
  • 4
1 Solution
 
Far22Author Commented:
actually this is the error message:
-23101 Unable to load locale categories.
0
 
ozoCommented:
is dosql a perl program?
if so, could you show us the source code of dosql?
0
 
Far22Author Commented:
dosql is a command of informix.
actually i found out that by typing "which dosql " in linux terminal.

and i found : /informix/bin
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Far22Author Commented:
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
0
 
Adam314Commented:
What user runs dosql when started by cron?  What user when started from command line?  Does cron user have permission?

You can set an environment variable with:
VariableName=Value
export VariableName
0
 
Far22Author Commented:
thanks a lot for your quick response.
yah , it was environment problem and i export some variables . it's working fine now.

thanks
Far22
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now