如何在 COBOL 中合并两个文件并创建具有匹配字段的报告
我有两个文件: 第一个文件包含作业名称和开始时间,如下所示:
ZPUDA13V STARTED - TIME=00.13.30
ZPUDM00V STARTED - TIME=03.26.54
ZPUDM01V STARTED - TIME=03.26.54
ZPUDM02V STARTED - TIME=03.26.54
ZPUDM03V STARTED - TIME=03.26.56
第二个文件包含作业名称和结束时间,如下所示:
ZPUDA13V ENDED - TIME=00.13.37
ZPUDM00V ENDED - TIME=03.27.38
ZPUDM01V ENDED - TIME=03.27.34
ZPUDM02V ENDED - TIME=03.27.29
ZPUDM03V ENDED - TIME=03.27.27
现在我尝试组合这两个文件来获取像 JOBNAME START TIME ENDTIME 这样的报告。我已经使用 ICETOOL 来获取报告如果我得到 JOBNAME START TIME,ENDTIME 是空格。如果我得到 Endtime,JOBNAME START TIME 会得到空格。 请让我知道如何对 outrec 字段进行编码,因为我已经用几乎所有可能性进行了编码以获得所需的字段。但我的输出仍然与我需要的不一样
I have two files :
first file contains jobname and start time which looks like below:
ZPUDA13V STARTED - TIME=00.13.30
ZPUDM00V STARTED - TIME=03.26.54
ZPUDM01V STARTED - TIME=03.26.54
ZPUDM02V STARTED - TIME=03.26.54
ZPUDM03V STARTED - TIME=03.26.56
and the second file contains jobname and Endtime which looks like below:
ZPUDA13V ENDED - TIME=00.13.37
ZPUDM00V ENDED - TIME=03.27.38
ZPUDM01V ENDED - TIME=03.27.34
ZPUDM02V ENDED - TIME=03.27.29
ZPUDM03V ENDED - TIME=03.27.27
Now I am trying to combine these two files to get the report like JOBNAME START TIME ENDTIME.I have used ICETOOL to get the report If I get JOBNAME START TIME ,ENDTIME is SPACES .If I get Endtime ,JOBNAME START TIME gets spaces.
Please let me know how to code the outrec fields as I have coded with almost all possibilites to get the desired one.But still my output is not the same as I required
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道 ICETOOL 是什么(甚至也不想在 Google 中查找它:-),但这是一个经典的 COBOL 数据处理任务。
根据您的简单数据输入,该算法将是:
但是,您可能需要考虑以下事实:
您可以通过确保 E 记录是紧随 S 记录之后的记录(基于时间)来解决第一个问题。 第二个问题很棘手。
如果您在 z/OS 上运行(考虑到作业名称,您可能是在 z/OS 上运行),您是否考虑过使用 SMF 记录中的信息来进行此收集和分析。 我非常确定 SMF 30 型唱片可以容纳您需要的一切。
假设这是一个大型机问题,这里有一个我工作中的朋友写的一本书的无耻插件,请查看大型机到底是什么? 作者:David Stephens (ISBN-13 = 978-1409225355)。
I have no idea what ICETOOL is (nor the inclination to even look it up in Google :-) but this is a classic COBOL data processing task.
Based on your simple data input, the algorithm would be:
However, you may need to take into account the fact that:
You could get around the first problem by ensuring the E record was the one immediately following the S record (based on time). The second problem is a doozy.
If you're running on z/OS (and you probably are, given the job names), have you considered using information from the SMF records to do this collection and analysis. I'm pretty certain SMF type 30 records hold everything you need.
And assuming this is a mainframe question, here's a shameless plug for a book one of my friends at work has written, check out What On Earth is a Mainframe? by David Stephens (ISBN-13 = 978-1409225355).
我知道,我的解决方案太晚了,但可能对 stackoverflow 的新手有帮助。
您可以使用 JCL 来利用
DFSORT
的JOINKEYS
。outrec 将根据您的需要保存数据!
I know, i'm toooo late with my resolution, but may be helpful for new comers to stackoverflow
You can make use of
JOINKEYS
ofDFSORT
using JCL.the outrec will hold the data as you need!