close all
clear all
release all
sj0=SECONDS()
set safe off
SET EXACT ON
set date to ansi
SET CENTURY ON
set mark to "-"
SET MEMOWIDTH TO 1024
SET TEXTMERGE ON
DEFINE WINDOW output FROM 0,0 TO 25,132 TITLE 'output' CLOSE FLOAT GROW ZOOM
old=sys(5)+sys(2003)
zk="E:\work\终审错误表\201301\dbf\汇总201301.dbf"
pt1=uppe(allt(getfile([dbf],"D:\lyy1","请选择错误库")))
*input '请输入产品类型:1—学位论文,2—期刊,3—会议论文?' to j
if substr(pt1,at('\',pt1,6)+11,1)='C'
ALTER TABLE (pt1) add COLUMN 部门说明 c(254)
use
ALTER TABLE (pt1) add COLUMN 错误描述 c(254)
use
ALTER TABLE (pt1) add COLUMN filename c(20)
repl all 错误描述 with error
repl all filename with 编号
index on filename to 1
use(zk) in 2
select 2
append from (pt1)
repl 产品类型 with '学位论文', 来库日期 with date(), 批次库名 with substr(pt1,at('\',pt1,6)+1), 审查部门 with '产品质检部',审查批次 with substr(pt1,at('\',pt1,6)+5,4) for empty(产品类型)
index on filename to 2
SET RELATION TO b.filename INTO A ADDITIVE
repl 标题 with '[中文题名] '+a.中文题名 for a.filename=b.filename
SET ORDER TO 0
else
if substr(pt1,at('\',pt1,6)+9,1)='_'
ALTER TABLE (pt1) add COLUMN 部门说明 c(254)
use
ALTER TABLE (pt1) add COLUMN 错误描述 c(254)
use
ALTER TABLE (pt1) add COLUMN filename c(20)
repl all 错误描述 with error
repl all filename with thname
repl all 部门说明 with 说明
index on filename to 1
use(zk) in 2
select 2
append from (pt1)
repl 产品类型 with '期刊', 来库日期 with date(), 批次库名 with substr(pt1,at('\',pt1,6)+1), 审查部门 with '产品质检部',审查批次 with substr(pt1,at('\',pt1,6)+5,4) for empty(产品类型)
index on filename to 2
SET RELATION TO b.filename INTO A ADDITIVE
repl 标题 with '[中文刊名] '+a.中文刊名 for a.filename=b.filename
SET ORDER TO 0
else
if substr(pt1,at('\',pt1,6)+1,3)='DBF'
ALTER TABLE (pt1) add COLUMN 部门说明 c(254)
use
ALTER TABLE (pt1) add COLUMN 错误描述 c(254)
use
ALTER TABLE (pt1) add COLUMN filename c(20)
repl all 错误描述 with error
repl all filename with 代码
repl all 部门说明 with 说明
index on filename to 1
use(zk) in 2
select 2
append from (pt1)
repl 产品类型 with '会议论文', 来库日期 with date(), 批次库名 with substr(pt1,at('\',pt1,6)+1), 审查部门 with '产品质检部',审查批次 with substr(pt1,at('\',pt1,6)+9,4) for empty(产品类型)
index on filename to 2
SET RELATION TO b.filename INTO A ADDITIVE
repl 标题 with '[论文集名称] '+a.论文集名称 for a.filename=b.filename
SET ORDER TO 0
else
if substr(pt1,at('\',pt1,5)+7,2)='士'
ALTER TABLE (pt1) add COLUMN 错误描述 c(254)
use
ALTER TABLE (pt1) add COLUMN 部门说明 c(254)
use
ALTER TABLE (pt1) add COLUMN filename c(20)
repl all 错误描述 with errcon for errkind<>'分类错误'
repl all filename with sn
index on filename to 1
use(zk) in 2
select 2
append from (pt1)
repl 产品类型 with '学位论文', 来库日期 with date(), 批次库名 with substr(pt1,at('\',pt1,5)+1), 审查部门 with '终审',审查批次 with substr(pt1,at('\',pt1,5)+1,4) for empty(产品类型)
index on filename to 2
SET RELATION TO b.filename INTO A ADDITIVE
repl 标题 with '[题名] '+a.title for a.filename=b.filename
SET ORDER TO 0
else
if substr(pt1,at('.',pt1,1)-2,2)='术'
ALTER TABLE (pt1) add COLUMN 错误描述 c(254)
repl all 错误描述 with errcon for errkind<>'分类错误'
index on filename to 1
use(zk) in 2
select 2
append from (pt1)
repl 产品类型 with '期刊', 来库日期 with date(), 批次库名 with substr(pt1,at('\',pt1,5)+1), 审查部门 with '终审',审查批次 with substr(pt1,at('\',pt1,5)+1,4) for empty(产品类型)
index on filename to 2
SET RELATION TO b.filename INTO A ADDITIVE
repl 标题 with '[篇名] '+a.title for a.filename=b.filename
SET ORDER TO 0
else
if substr(pt1,at('.',pt1,1)-1,1)='S'
ALTER TABLE (pt1) add COLUMN 错误描述 c(254)
repl all 错误描述 with errcon for errkind<>'分类错误'
index on filename to 1
use(zk) in 2
select 2
append from (pt1)
repl 产品类型 with '期刊', 来库日期 with date(), 批次库名 with substr(pt1,at('\',pt1,5)+1), 审查部门 with '终审',审查批次 with substr(pt1,at('\',pt1,5)+1,4) for empty(产品类型)
index on filename to 2
SET RELATION TO b.filename INTO A ADDITIVE
repl 标题 with '[篇名] '+a.title for a.filename=b.filename
SET ORDER TO 0
else
if substr(pt1,at('\',pt1,5)+1,4)='终审'
ALTER TABLE (pt1) add COLUMN filename c(20)
repl all filename with 文章编号
use(zk) in 2
select 2
append from (pt1)
repl 产品类型 with '会议论文', 来库日期 with date(), 批次库名 with substr(pt1,at('\',pt1,5)+1), 审查部门 with '终审',审查批次 with substr(pt1,at('\',pt1,5)+17,4) for empty(产品类型)
else
?'无错误库'
endif
endif
endif
endif
endif
endif
endif
2016年07月13日 03点07分
2