IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Updating a VSAM file with DISP=OLD


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sheersh

New User


Joined: 24 May 2008
Posts: 17
Location: Gurgaon

PostPosted: Tue Mar 14, 2017 6:14 pm
Reply with quote

I am updating a VSAM file with DISP=OLD via cobol program. same file is used in many jobs as DISP=SHR (read only) though out the day. I understand if say 20 jobs are using file in DISP=SHR and my update job comes in queue, it will wait till those 20 jobs are finished.

suppose another 10 jobs with DISP=SHR for same file come to queue while update jobs is waiting to finish first lot of the jobs? would they jump the queue and get access before DISP=OLD or first my update job will run and then rest of the read jobs?
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue Mar 14, 2017 6:18 pm
Reply with quote

The answer is....

or first my update job will run and then rest of the read jobs?

Your Job will enqueue the dataset. Any job after that will wait on your job.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Tue Mar 14, 2017 7:12 pm
Reply with quote

I'm pretty sure Mr. Porcelan's description is correct. I think I have seen this behavior myself. But is there any formal statement this is the correct behavior? To my mind it violates the concept of DISP=SHR. I always thought the running DISP=SHR jobs should block the DISP=OLD job, but the queued DISP=OLD job should not block new DISP=SHR jobs.

I grant there is also a fair argument that the queued DISP=OLD job should block new DISP=SHR jobs as Mr. Poreclan and I both observed, but is this actually documented? I recall wondering about this something like 20 years ago, but I don't think I ever researched it. I can say the antique JCL Reference manual I just looked at seems to be silent about this.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue Mar 14, 2017 7:31 pm
Reply with quote

I just ran a TEST (imagine that) to confirm my answer.

I does indeed work as expected.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Tue Mar 14, 2017 8:03 pm
Reply with quote

The z/OS 2.1 JCL User's Guide says on page 110
Quote:
Exclusive control of a data set
When a job has exclusive control of a data set, no other job can use that data set until completion of the last step in the job that refers to the data set except when downgrading ENQs. A job should have exclusive control of a data set in order to modify, add, or delete records.
and on page 111:
Quote:
The job receives control of the data set if:
v Another job is not using the data set.
v Another job is using the data set but both the job requesting the data set and the job using the data set request shared control and no exclusive requests are pending.

The job does not receive control of a data set if:
v Another job is using the data set and that job has exclusive control.
v Another job is using the data set, with either exclusive or shared control, and this job requests exclusive control.
v Another job is using the data set, with shared control, and yet another, earlier job requests exclusive control.

If a job requests data sets that are not available, the system issues the message ‘JOB jjj WAITING FOR DATA SETS’ to the operator. The job waits until the required data sets become available, unless the operator cancels the job.
Back to top
View user's profile Send private message
sheersh

New User


Joined: 24 May 2008
Posts: 17
Location: Gurgaon

PostPosted: Tue Mar 14, 2017 8:03 pm
Reply with quote

thanks guys. it helps!
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Mar 15, 2017 2:18 pm
Reply with quote

@ sheersh

Just my two cent too:

Also think about the vsam share levels. Parallel updates. I come across this, because you told that the same file is used in many jobs with DISP=SHR.

Second point: Is your site using any job scheduling system like OPC ore something else. In OPC (TWS) you could block access via a SpecialResource statment.
Back to top
View user's profile Send private message
sheersh

New User


Joined: 24 May 2008
Posts: 17
Location: Gurgaon

PostPosted: Wed Mar 15, 2017 4:25 pm
Reply with quote

@ UmeySan - thanks. Yes i have considered share levels and mine would be the only jcl updating the file, rests all will be reading it. We do use CA7 and can set up file /resource requirement but that need to be set on all jobs .. while I can easily set it for my new job. there are thousands of jobs which are already in production and not practical to update scheduling for all.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Mar 15, 2017 5:43 pm
Reply with quote

Sorry about that. I'm only common to OPC, where you can specify this based on particular job without having to modify any other existing jobs jobs.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts how to eliminate null indicator value... DB2 7
No new posts VSAM LISTCAT INFORMATION JCL & VSAM 2
No new posts Format Binary file to EBCDIC JCL & VSAM 4
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
Search our Forums:

Back to Top