根据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 =(NEW,CATALOG,DELETE)相同的数据集的JCL。我得到一条TSO消息,因为作业请求数据集,并且在我通过ISPF发布数据集之前JCL不会启动。
b)我提交2个JCL使用与DISP =(NEW,CATALOG,DELETE)相同的数据集,但两者都是同时开始的。
为什么作业并行运行时请求独占访问数据集?
答案 0 :(得分:3)
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.