?
Solved

how to fix error: unable to load local category

Posted on 2006-05-10
9
Medium Priority
?
1,286 Views
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:

#!/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
Comment
Question by:Far22
  • 4
6 Comments
 

Author Comment

by:Far22
ID: 16653190
actually this is the error message:
-23101 Unable to load locale categories.
0
 
LVL 85

Expert Comment

by:ozo
ID: 16655759
is dosql a perl program?
if so, could you show us the source code of dosql?
0
 

Author Comment

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

and i found : /informix/bin
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Far22
ID: 16655807
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
 
LVL 39

Accepted Solution

by:
Adam314 earned 2000 total points
ID: 16661564
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
 

Author Comment

by:Far22
ID: 16662580
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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…
Six Sigma Control Plans
Suggested Courses

850 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