如何在COBOL中创建一个带有两个条目的文件?
我有两个文件,第一个文件具有日期,第二个文件具有多个寄存器。 我想创建类似的东西:
输入文件1:
20200509
输入文件2:
0000001
0000002
0000003
输出
202005090000001
202005090000002
202005090000003
谢谢你。
I have two files, the first one has the date and the second one has multiple registers.
I want to create something like this:
Input File 1:
20200509
Input File 2:
0000001
0000002
0000003
Output
202005090000001
202005090000002
202005090000003
Thank u.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
建立两个字段的记录。我不会给你图片条款。
读取文件并填充字段一个。 (野外一件事)。
读取文件二,每个记录,填充字段二并编写输出记录。
场一永不更改?
如果您有片刻,您的商店就可以查看加入行动(填充?)。
文件中的记录可能应该是参数。
是的,您需要打开和关闭文件,使用filestat并了解启动读数是什么。
如果您不介意不好的风格和ANS COBOL c。 1972年见
https://github.com/mckenzm/mckenzm/join2files/join2files/blob/blob/blob/blob/main/main/main/stacex11 cbl
(没有filestat,没有例外(空文件)处理。)
Build a record of two fields. I will not give you picture clauses.
Read file one and populate field one. (end of field one stuff).
Read file two and for each record, populate field two and write an output record.
Field one never changes?
Look into JOINKEYS (FILL?) if you get a moment and your shop has it.
And the record in File one should probably be a parameter.
Yes you will need to open and close the files, use filestat, and understand what a priming read is.
If you don't mind bad style and ANS COBOL c. 1972 see
https://github.com/mckenzm/join2files/blob/main/stackex1.cbl
(No filestat, no exception (empty file) handling.)