- 论坛徽章:
- 0
|
DIR=${INFORMIXDIR-/usr/informix}
dbaccess - - << !
database xjyc;
unload to /usr/depo/qym/q1.txt select sum(famt) from yh_fymx where
fdate=20040418 and ano=0 ;
unload to /usr/depo/qym/q2.txt select -sum(famt) from xjyc_ls where
fdate=20040418 and ano=0 and flag=7;
!
diff q1.txt q2.txt >; q3
if [ $? -eq 0 ]
then
echo "现金缴费ok"
dbaccess - - << !
database xjyc;
unload to /usr/depo/qym/qym_fymx select ano, sum(famt) from yh_fymx where
fdate=20040418 and ano>;0 group by ano order by ano;
unload to /usr/depo/qym/qym_ls select ano,-sum(famt) from xjyc_ls where
fdate=20040418 and ano>;0 and flag=7 group by ano order by ano;
!
diff qym_fymx qym_ls >; q4
if [ $? -eq 0 ]
then
echo "代缴划拨 ok"
else
cat q4
fi
else
cat q3
dbaccess - - << !
database xjyc;
unload to /usr/depo/qym/xj_fymx.txt select yh_no,sum(famt) from yh_fymx where
fdate=20040418 and ano=0 group by qt_num order by qt_num;
unload to /usr/depo/qym/xj_ls.txt select qt_num ,-sum(famt) from xjyc_ls
where fdate=20040418 and ano=0 and flag=7 group by qt_num order by qt_num;
unload to /usr/depo/qym/kh_fymx.txt select sum(famt) from yh_fymx where
fdate=20040418 and ano>;0 ;
unload to /usr/depo/qym/kh_ls.txt select -sum(famt) from xjyc_ls where
fdate=20040418 and ano>;0 and flag=7;
!
diff xj_fymx.txt xj_ls.txt >; xjbj
cat xjbj
diff kh_fymx.txt kh_ls.txt >; khje
if [ $? -eq 0 ]
then
echo " ok"
else
dbaccess - - << !
database xjyc;
unload to /usr/depo/qym/kh_fymx1.txt select ano, sum(famt) from yh_fymx
where fdate=20040418 and ano>;0 group by ano order by ano;
unload to /usr/depo/qym/kh_ls1.txt select ano,-sum(famt) from xjyc_ls
where fdate=20040418 and ano>;0 and flag=7 group by ano order by ano;
!
diff kh_fymx1.txt kh_ls1.txt >; khbj
cat khbj
fi
fi
本人操作系统为SCOunix,老提示 syntax error at line 文件尾行数: `end of file' unexpected |
|