批处理作业在 AS400 上共享相同的 QTEMP 库吗?

发布于 2024-12-19 02:17:32 字数 145 浏览 1 评论 0原文

假设有一个程序,它将文件复制到临时文件,对数据进行一些操作并将其复制回来。现在,如果我提交它批量运行两次,将会有两个批处理作业,它们可能会同时执行相同的文件技巧。由于文件位于同一个库中,一个是否会给另一个带来麻烦,例如扭曲另一个的数据?将会发生什么?假设对象锁在这里不是问题。

Suppose there is a program, which copies a file to temp, does some manipulation to the data and copies it back. Now if I submit it to run in batch for twice, there will be two batch jobs which are likely to do the same file tricks in the same time. Is one going to cause trouble to the other, like distorting the data of the other, since the file is located in the same library? What is going to happen? Let us say object lock is not an issue here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无声静候 2024-12-26 02:17:32

QTEMP 对于系统上的每个作业都是唯一的,并且在作业 QTEMP 库中创建的所有对象在作业结束时都将被删除。

因此,在您的示例中,每个批处理作业都将拥有自己独特的 QTEMP 库,并且不会干扰其他作业。

QTEMP is unique to each individual job on the system and all objects created in the jobs QTEMP library are removed when the job ends.

Therefore in your example each batch job will have it's own unique QTEMP library and will not interfere with the other.

哽咽笑 2024-12-26 02:17:32

我认为在这些情况下你总会遇到数据失真的问题:
作业1更新生日; 更新邮政编码

Job 1 cpyf prod/x qtemp/x
Job 2 cpyf prod/x qtemp/x
Job 1 call updbirth
Job 2 call updpostal

作业 2此时

,文件 X 存在三个单独的副本: 1) 生产。邮政编码和出生日期均未更新,但其他一些职位可能已更新姓名和地址。对此副本所做的更新不会反映在作业 1 或作业 2 的文件副本中 X

2) 作业 1。此副本更新了出生日期,但没有更新邮政编码或自作业 1 开始以来在生产中所做的更改。

3) 作业 2。此副本已更新邮政编码,但未更新出生日期或自作业 2 开始以来生产中所做的更改。

无论哪个文件被复制回生产环境,在生产环境中所做的所有更改都将丢失。然后,当其他工作文件被复制回生产环境时,所有这些更改也将丢失。生成的生产文件将仅包含最后一个批处理程序为更新工作文件所做的更改。

I think you will always have a problem with distorted data under these circumstances:
Job 1 updates birthdate; Job 2 updates postal code

Job 1 cpyf prod/x qtemp/x
Job 2 cpyf prod/x qtemp/x
Job 1 call updbirth
Job 2 call updpostal

at this point, there are three separate copies of file X:

1) Production. Neither postal code nor birth date have been updated, but some other job may have updated name and address. Updates made to this copy are not reflected in Job 1 or Job 2's copy of file X

2) Job 1. This copy has updated birth dates, but not postal codes or changes made in production since Job 1 started.

3) Job 2. This copy has updated postal codes, but not birth dates or changes made in production since Job 2 started.

No matter which file gets copied back to production, all changes made in production will be lost. Then, when the other work file gets copied back to production, all of those changes will be lost too. The resulting production file will only contain changes made by the last batch program to update the work file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文