2011-07-04 16 views
0

根據MVS JCL參考指南工作啓動請求數據集的獨家控制權之前: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. 

但是我有兩個不同的行爲:

一)我通過ISPF DATASET_A打開並提交一個使用與DISP =(NEW,CATALOG,DELETE)相同的數據集的JCL。我收到TSO消息是因爲作業請求了數據集,並且直到我通過ISPF發佈數據集時JCL纔會啓動。 b)我提交了2個使用與DISP =(NEW,CATALOG,DELETE)相同的數據集但同時開始的JCL's。

爲什麼作業在並行運行時請求不能獨佔訪問數據集?

回答

3

b)中的工作不像您期望的那樣工作的原因是您在同一時間啓動它們。 它們都創建了一個同名的新數據集,這是允許的。 當完成第一個作業時應該對數據集進行編目,第二個作業會因爲已經編目而得到NOTCAT2錯誤。

disp語句(目錄)的第二部分是成功的步驟會發生什麼,第三部分(刪除)是不成功的步驟會發生什麼。

要創建新的數據集,並獲得獨佔訪問使用

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

+0

兩者如果是這樣的原因,如果我用DISP = MOD或DISP = OLD他們應該請求獨佔訪問,對嗎? – user823959

+0

DISP = OLD意味着它必須已經存在,否則將會失敗,但是如果數據集存在,它確實意味着獨佔訪問。 – Deuian

+0

它也說: '舊 - 表明數據集在這一步之前存在,並且這一步需要獨佔(非共享)使用數據集。' 奇怪,但DISP =(MOD,KEEP,KEEP)滿足我的需求。 – user823959