sele 1 USE d:/dbf/lyc1.dbf IN 0 EXCLUSIVE dele all pack append from d:/dbf/out.txt fields xm,xb,sbbh,ryfl delimited with "," brow
2.將out1.txt 導(dǎo)入到lyc1.dbf (out1.txt來自與醫(yī)保個人帳戶電子文檔,分單位,包含個人的姓名、性別、社保編號、在職工資、退休工資等信息) sele 2 USE d:/dbf/lyc1_1.dbf IN 0 EXCLUSIVE dele all pack append from d:/dbf/out1.txt fields xh,xm,sbbh,zgz,tgz delimited with "," brow
四、比較兩個數(shù)據(jù)庫的個人信息,設(shè)標(biāo)記 do 1 1.prg SET DEFAULT TO d:/dbf SET PATH TO d:/dbf select 1 use lyc1 select 2 use lyc1_1 do while not eof() select 1 go 1 locate for xm = lyc1_1 -> xm do while not eof() if sbbh = lyc1_1 -> sbbh 假如姓名相同,社保編號也相同,設(shè)標(biāo)記為y replace xh with lyc1_1 -> xh replace bj with "y" replace lyc1_1 -> bj with "y" if ryfl="在職" and lyc1_1 -> tgz > 0 假如有退休工資,不能是在職 replace ryfl with "在職?" endif if ryfl="退休" and lyc1_1 -> zgz > 0 replace ryfl with "退休?" endif if ryfl=" " and lyc1_1 -> tgz > 0 replace ryfl with "?退休" endif if ryfl=" " and lyc1_1 -> zgz > 0 replace ryfl with "?在職" endif exit else if bj<>"y" 假如標(biāo)記沒設(shè)為y replace xh with lyc1_1 -> xh replace bj with "n" 姓名相同,社保編號不同,設(shè)標(biāo)記為n endif continue endif enddo select 2 skip 1 enddo sele 1 use sele 2 use do 2 2.prg SET DEFAULT TO d:/dbf SET PATH TO d:/dbf select 1 use lyc1 select 2 use lyc1_1 select 1 go 1 do while not eof() if bj="n" select 2 go 1 locate for xm = lyc1 -> xm if not eof() replace db with lyc1 -> sbbh 姓名相同,對比社保編號 replace lyc1 -> db with sbbh endif endif select 1 if bj=" " select 2 go 1 locate for sbbh = lyc1 -> sbbh if not eof() replace db with lyc1 -> xm 社保編號相同,對比姓名 replace lyc1 -> db with xm endif endif select 1 skip 1 enddo sele 1 use sele 2 use
六、打印排錯信息 do p3 p3.prg clear set print on set device to print set default to d:/dbf set path to d:/dbf select 1 use lyc1 i=2 @1,10 say " 醫(yī)保數(shù)據(jù)庫 錯誤記錄:" @2,10 say '序號 '+'姓名 '+'性別'+' 社保編號 '+' 人員分類 '+'對比提示' locate for bj="n" do while not eof() i=i+1 if i>76 @1,10 say " 醫(yī)保數(shù)據(jù)庫 錯誤記錄:" @2,10 say '序號 '+'姓名 '+'性別'+' 社保編號 '+' 人員分類 '+'對比提示' i=3 endif @i,10 say str(xh,4,0)+" "+xm+xb+" "+substr(sbbh,1,30)+ryfl+" "+db continue enddo go 1 i=2 @1,10 say "****************醫(yī)保數(shù)據(jù)庫 無對應(yīng)記錄:******************" @2,10 say '序號 '+'姓名 '+'性別'+' 社保編號 '+'人員分類 '+'對比提示' locate for bj=" " do while not eof() i=i+1 if i>76 @1,10 say "****************醫(yī)保數(shù)據(jù)庫 無對應(yīng)記錄:****************" @2,10 say '序號 '+'姓名 '+'性別'+' 社保編號 '+'人員分類 '+'對比提示' i=3 endif @i,10 say str(xh,4,0)+" "+xm+xb+" "+substr(sbbh,1,30)+ryfl+" "+db continue enddo go 1 i=i+1 @i,10 say "****************醫(yī)保數(shù)據(jù)庫 分類有問題:****************" i=i+1 @i,10 say '序號 '+'姓名 '+'性別'+' 社保編號 '+'人員分類 '+'對比提示' locate for at('?',ryfl)>0 do while not eof() i=i+1 if i>76 @1,10 say "****************醫(yī)保數(shù)據(jù)庫 分類有問題:****************" @2,10 say '序號 '+'姓名 '+'性別'+' 社保編號 '+'人員分類 '+'對比提示' i=3 endif @i,10 say str(xh,4,0)+" "+xm+xb+" "+substr(sbbh,1,30)+ryfl+" "+db continue enddo count all to t count all for bj="y" to s count all for ryfl="在職" to zs count all for ryfl="退休" to tx @i+1,10 say "****醫(yī)保數(shù)據(jù)庫 正確記錄數(shù):"+str(s,4,0)+"/"+str(t,4,0)+"/在職"+str(zs,4,0)+"/退休"+str(tx,4,0)
select 2 use lyc1_1 i=2 @1,10 say "======校對文稿 無對應(yīng)記錄:=======" @2,10 say '序號 '+'姓名 '+'性別'+' 社保編號 '+'對比提示' locate for bj=" " do while not eof() i=i+1 if i>76 @1,10 say "======校對文稿 無對應(yīng)記錄:========" @2,10 say '序號 '+'姓名 '+'性別'+' 社保編號 '+'對比提示' i=3 endif @i,10 say str(xh,4,0)+" "+xm+xb+" "+substr(sbbh,1,30)+" "+db continue enddo count all to t count all for bj="y" to s count all for zgz > 0 to zs count all for tgz > 0 to tx @i+1,10 say "========校對文稿 校對正確記錄數(shù):"+str(s,4,0)+"/"+str(t,4,0)+"/在職"+str(zs,4,0)+"/退休"+str(tx,4,0)
eject sele 1 use sele 2 use set print off set device to screen