根据MVS JCL参考指南,在作业开始之前,它请求对数据集的独占控制:
DISP and ENQ: Before starting the first step of a job, the initiator requests
control of all of the data sets in that job by issuing an ENQ for each of them,
using the value specified for DISP to determine the kind of ENQ issued. The
initiator issues the ENQ for each data set at the highest level required for that
data set by any step of the job. For example, if all steps of the job request
shared control of a specific data set (DISP=SHR) then the ENQ for that data set
is requested as SHR. If, on the other hand, any step of the job requests
exclusive control of a specific data set (DISP=NEW, DISP=MOD, or DISP=OLD), then
the ENQ for that data set is requested EXCL.但我得到了两种不同的行为:
a)我通过ISPF DATASET_A打开并提交一个使用与DISP=相同的数据集的JCL (新建、编目、删除)。我收到一条TSO消息,因为作业请求数据集,而JCL在我通过ISPF释放数据集之前不会启动。
b)我提交了两个JCL,这两个JCL与DISP=(新建、目录、删除)使用相同的数据集,但两者同时开始。
为什么作业在并行运行时不请求对数据集的独占访问?
发布于 2011-07-05 22:03:42
b)中的作业不像您期望的那样工作的原因是您同时启动它们。它们都创建了一个同名的新数据集,这是允许的。当作业完成时,首先完成的作业应该编目数据集,第二个作业将得到NOTCAT2错误,因为它已经编目。
disp语句的第二部分(Catalog)是成功步骤的结果,第三部分(Delete)是不成功步骤的结果。
创建新的数据集并获得独占访问权限
MOD表示以下其中一项:
* The data set exists and records are to be added to the end of it. The data set must be sequential.
* A new data set is to be created.
In either case, MOD specifies exclusive (unshared) use of the data set. 摘自IBM Manual
https://stackoverflow.com/questions/6574943
复制相似问题