C# 程序员的 COBOL Copybook 规范
我正在开发一个应用程序,它要求我生成 COBOL copybook 来定义数据文件。
有人有关于如何写字帖的好参考吗?
I am working on an application that requires me to produce a COBOL copybook to define a data file.
Does anyone have a good reference on how to write out a copybook?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“抄写本”基本上是 COBOL 所说的包含文件。 您需要以 COBOL 格式编写数据描述。 这是教程。 这里还有一些其他好文章。
A "copybook" is basically COBOL speak for an include file. You need to write a description of your data in COBOL format. Here's a tutorial. Here's some other good articles.
首先澄清一下,我认为您不需要语法,它只是来自数据部门或过程部门的 COBOL 代码行。
那么格式化文件布局的方法是什么呢? 您需要认识到这是非常低级的数据建模。 因此,您需要真正了解您的数据是什么样的。 您可以研究各种数据建模方法,但我建议从您所知道的开始。 如果您知道如何对数据库表建模,请像设计表一样设计它。 然后转换为文件格式。
这可能会突出显示您有多个实体需要建模。 然后您可能会决定您确实需要多个文件,或者您可能能够将几个记录组合成一个长文件(展平)或使用 REDEFINES 创建“辅助”记录和某种差异键来告诉您哪种类型数据在此记录中。
First to clarify, I presume you are not asking for the syntax, which is just lines of COBOL code from either the DATA DIVISION or PROCEDURE DIVISION.
So what is the way to format a file layout? You need to recognize that this is very low-level data modeling. So you need to really understand what your data looks like. You can research various data modeling methodologies, but I suggest starting with what you know. If you know how to model a database table, design it like you would the table. Then convert to the file format.
This will probably highlight that you have multiple entities to model. Then you might decide that you really need multiple files, or you might be able to get away with combining a couple records into a long file (flattening) or create "auxiliary" records using REDEFINES and some kind of variance key to tell you which type of data is in this record.