如何从cobol数据形成XFD

如何从cobol数据形成XFD,cobol,Cobol,我将尝试根据以下文件设置选项重新定义XFD文件结构 Anaylsis Result: Max Record length 300 Min record length 61 No of records 466 Blocking factor 1 Preallocation amount 0 Extension amount 1 Compression factor 80 Encrypted ? No Number of keys 4 Primary key has 1 segments key

我将尝试根据以下文件设置选项重新定义XFD文件结构

Anaylsis Result:

Max Record length 300
Min record length 61
No of records 466
Blocking factor 1
Preallocation amount 0
Extension amount 1
Compression factor 80
Encrypted ? No
Number of keys 4
Primary key has 1 segments
key size 13 offset 0

key 02 has 3 segments
Duplicates Are allowed
Key size 4 offset 4
Key size 40 offset 21
Key size 4 offset 0

Key 03 has 3 segments
Duplicates Are allowed
Key size 4 offset 4
Key size 8 offset 13
Key size 4 offset 0

Key04 has 1 segment
Duplicates Are allowed
Key size 10 offset 21
另一个给定的XFD文件结构已无法从ACUDBC获取数据: 我正在通过acudbc将pote.XFD链接到pote Acu数据库文件

XFD,02,POTE,POTE
00026,00018,002
1,0,008,00000
02
INTIND-UNIQ
INTIND-OCC
1,1,010,00008
01
IND16
000
0004,00004
00000,00004,12,00009,+00,000,000,INTIND-UNIQ
00004,00004,12,00009,+00,000,000,INTIND-OCC
00008,00010,16,00010,+00,000,000,IND16
00018,00008,16,00008,+00,000,000,TERM20
我正在通过acudbc将pote.XFD链接到pote Acu数据库文件。 我的问题是,如何根据上面给出的give分析修改pote.XFD结构,以形成正确的XFD结构

# This xfd layout is a generic one suitable for accessing any 
# .DAD file. However, it needs to be copied and amended for each 
# DAD file that you wish to get access to. 
# The simplest scenario is that you copy dad.xfd to a new file 
# with the same name as the database you wish to access and extension .XFD 
# Then edit this new file and replace the two instances of 'FILE' with the 
# filename that you want to access. e.g. if you want to have ODBC access to 
# icvc.dad then copy dad.xfd to new file icvc.xfd and change line 
#   XFD,02,FILE,FILE            to be 
#   XFD,02,ICVC,ICVC 
# 
# If this doesn't work then the database file you are trying to access has 
# probably set different values for search index sizes. The easiest way to 
# check this is to run $list for the database that you want to access and 
# note down all the key information that it gives. If that is different 
# to the key info in this file then you need to modify the xfd file to match 
# In the current xfd there are four indexes defined. In all cases the first 
# index will be correct and so should the third index. However, the other 
# two may need to be modified or removed if not present. 
# Index 4 is optional and is not present if the database is rebuilt without 
# the fast list option. 
# explaining the details of 2nd index. 1 st line consists of 8 values separated 
# by commas. The first value of 3 is how many segments the index consists of. 
# second value 1 means duplicates allowed (0 means NO DUPS). 
# The remaining six fields are three pairs of key size and byte offset, e.g. 
# first index segment is 4 bytes long and starts from byte 4, second index 
# segment is 20 bytes long and starts from byte 21 etc. 
# The second line specifies how many field names there are to follow and lines 3 
# to 5 are the three field names as defined lower in this xfd. For instance 
# if you look at field D1UNIQ you will see it is defined as starting from byte 0 
# and is 4 bytes long. This corresponds to the values entered in the key definition. 
# 
XFD,02,ICVC,ICVC 
00300,00041,004 
# [Key Section] 
# [1st index] 
01,0,013,00000 
04 
D1UNIQ 
D1NAME 
D1NAMX 
D1OCCU 
# [2nd index] 
3,1,004,00004,020,00021,004,00000 
03 
D1NAME 
D1TUPP 
D1UNIQ 
# [3rd index] 
3,1,004,00004,008,00013,004,00000 
03 
D1NAME 
D1NUMB 
D1UNIQ 
# [4th index] 
1,1,020,00021 
01 
D1TUPP 
# [Condition Section] 
000 
# [Field Section] 
0015,00015,00016 
00000,00013,16,00013,+00,000,999,D1KEY 
00000,00004,12,00009,+00,000,000,D1UNIQ 
00004,00004,16,00004,+00,000,000,D1NAME 
00008,00001,16,00001,+00,000,000,D1NAMX 
00009,00004,12,00009,+00,000,000,D1OCCU 
00013,00008,11,00018,-06,000,000,D1NUMB 
00021,00040,16,00040,+00,000,000,D1TUPP 
00061,00001,01,00001,+00,000,000,D1GRAD 
00062,00004,12,00008,+00,000,000,D1DLUP 
00066,00004,12,00008,+00,000,000,D1TLUP 
00070,00004,16,00004,+00,000,000,D1OLUP 
00074,00001,16,00001,+00,000,000,D1TYPE 
00075,00002,16,00002,+00,000,000,D1FORM 
00077,00160,16,00160,+00,000,000,D1TEXT 
00237,00001,16,00001,+00,000,000,D1PRIN 
00238,00062,16,00062,+00,000,000,D1FILL 
我知道这个cobol表中有四个键,但我仍然不知道如何根据给定的分析信息手动配置此数据结构

下面是我已经获得的关于如何在手册中形成正确的XFD结构的另一个参考指南,希望有专家能够帮助解释如何在正确的XFD结构上形成

# This xfd layout is a generic one suitable for accessing any 
# .DAD file. However, it needs to be copied and amended for each 
# DAD file that you wish to get access to. 
# The simplest scenario is that you copy dad.xfd to a new file 
# with the same name as the database you wish to access and extension .XFD 
# Then edit this new file and replace the two instances of 'FILE' with the 
# filename that you want to access. e.g. if you want to have ODBC access to 
# icvc.dad then copy dad.xfd to new file icvc.xfd and change line 
#   XFD,02,FILE,FILE            to be 
#   XFD,02,ICVC,ICVC 
# 
# If this doesn't work then the database file you are trying to access has 
# probably set different values for search index sizes. The easiest way to 
# check this is to run $list for the database that you want to access and 
# note down all the key information that it gives. If that is different 
# to the key info in this file then you need to modify the xfd file to match 
# In the current xfd there are four indexes defined. In all cases the first 
# index will be correct and so should the third index. However, the other 
# two may need to be modified or removed if not present. 
# Index 4 is optional and is not present if the database is rebuilt without 
# the fast list option. 
# explaining the details of 2nd index. 1 st line consists of 8 values separated 
# by commas. The first value of 3 is how many segments the index consists of. 
# second value 1 means duplicates allowed (0 means NO DUPS). 
# The remaining six fields are three pairs of key size and byte offset, e.g. 
# first index segment is 4 bytes long and starts from byte 4, second index 
# segment is 20 bytes long and starts from byte 21 etc. 
# The second line specifies how many field names there are to follow and lines 3 
# to 5 are the three field names as defined lower in this xfd. For instance 
# if you look at field D1UNIQ you will see it is defined as starting from byte 0 
# and is 4 bytes long. This corresponds to the values entered in the key definition. 
# 
XFD,02,ICVC,ICVC 
00300,00041,004 
# [Key Section] 
# [1st index] 
01,0,013,00000 
04 
D1UNIQ 
D1NAME 
D1NAMX 
D1OCCU 
# [2nd index] 
3,1,004,00004,020,00021,004,00000 
03 
D1NAME 
D1TUPP 
D1UNIQ 
# [3rd index] 
3,1,004,00004,008,00013,004,00000 
03 
D1NAME 
D1NUMB 
D1UNIQ 
# [4th index] 
1,1,020,00021 
01 
D1TUPP 
# [Condition Section] 
000 
# [Field Section] 
0015,00015,00016 
00000,00013,16,00013,+00,000,999,D1KEY 
00000,00004,12,00009,+00,000,000,D1UNIQ 
00004,00004,16,00004,+00,000,000,D1NAME 
00008,00001,16,00001,+00,000,000,D1NAMX 
00009,00004,12,00009,+00,000,000,D1OCCU 
00013,00008,11,00018,-06,000,000,D1NUMB 
00021,00040,16,00040,+00,000,000,D1TUPP 
00061,00001,01,00001,+00,000,000,D1GRAD 
00062,00004,12,00008,+00,000,000,D1DLUP 
00066,00004,12,00008,+00,000,000,D1TLUP 
00070,00004,16,00004,+00,000,000,D1OLUP 
00074,00001,16,00001,+00,000,000,D1TYPE 
00075,00002,16,00002,+00,000,000,D1FORM 
00077,00160,16,00160,+00,000,000,D1TEXT 
00237,00001,16,00001,+00,000,000,D1PRIN 
00238,00062,16,00062,+00,000,000,D1FILL 
首先要做到:

“#此xfd布局是一种通用布局,适合访问任何
“#.爸爸档案。但是,需要为每个项目复制和修改
“#您希望访问的DAD文件
“#最简单的情况是将dad.xfd复制到一个新文件
“#与您希望访问和扩展的数据库同名。XFD
“#然后编辑此新文件并将“file”的两个实例替换为
“#要访问的文件名。e、 g.如果您希望对进行ODBC访问
“#icvc.dad然后将dad.xfd复制到新文件icvc.xfd并更改行
“#XFD,02,文件,文件将
“#XFD,02,ICVC,ICVC

如果不起作用,请按照说明查找有多少个键以及第二个键的值。如果发现只有三个键,请从模板中删除第四个键。如果第二个键的值不同,请在[FieldSection]中更改它们


在更改任何其他内容之前使其工作。

尝试搜索并跟踪链接。我可以使用“vutil32-info-k-x icvc”检查第一个、第二个(备用键)结构的数量。3,100400004020100400000,3表示存在3个键,1表示不允许重复,其余以“0”开头的可以从上面给出的命令中获得。但是仍然不够,我需要知道实际字段描述符沿其出现点和长度,以形成正确的XFD结构。没有这个,我就不能链接到Acucobol数据表,但我没有任何源代码。有没有其他方法可以通过在Explant中使用任何开放系统工具或反向工程技术来帮助我了解这些FD信息?如果您尝试了我所说的内容,但失败了,请更新您的问题,以包括您尝试的内容以及失败的原因。如果你没有试过我说的话,那就试一下。