how to fix error: unable to load local category

Posted on 2006-05-10
Last Modified: 2011-10-03
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:

# 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
mm=` date +%m`
dd=` date +%d`

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`
       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/ $edi_as2 >> $THELOG

                                                case "$result" in
                                                                  echo "$edi_as2 is NOT duplicated"
                                                                  scp $edi_as2 esp@ ###
                                                                  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'"      
                                                                  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' "
                                                                  echo "not a 820 file"
                                                                  echo "not 820 file"  >> $THELOG

                                                #####       scp $edi_as2 esp@   ###

                                                ##### mv $edi_as2 /usr4/edi/edi_backup/ > /dev/null 2>&1
                                                #####      cp mv $edi_as2 /usr4/edi/edi_backup/ > /dev/null 2>&1            
                                                                  echo "no record found in database" ;;


                                          echo "result : $result"
           echo "No file to send." >> $THELOG
echo "`date +%m/%d/%y-%H:%M:%S` : edi autosend.as2 ended -----" >> $THELOG
echo "------------------------------------------------------" >> $THELOG

exit 0

Question by:Far22

    Author Comment

    actually this is the error message:
    -23101 Unable to load locale categories.
    LVL 84

    Expert Comment

    is dosql a perl program?
    if so, could you show us the source code of dosql?

    Author Comment

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

    and i found : /informix/bin

    Author Comment

    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?

    LVL 39

    Accepted Solution

    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:
    export VariableName

    Author Comment

    thanks a lot for your quick response.
    yah , it was environment problem and i export some variables . it's working fine now.


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
    I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now