Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Updating a VSAM file with DISP=OLD

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sheersh

New User


Joined: 24 May 2008
Posts: 14
Location: Gurgaon

PostPosted: Tue Mar 14, 2017 6:14 pm    Post subject: Updating a VSAM file with DISP=OLD
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: 660
Location: Pennsylvania

PostPosted: Tue Mar 14, 2017 6:18 pm    Post subject:
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 User


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

PostPosted: Tue Mar 14, 2017 7:12 pm    Post subject:
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: 660
Location: Pennsylvania

PostPosted: Tue Mar 14, 2017 7:31 pm    Post subject:
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: 7992
Location: Bellevue, IA

PostPosted: Tue Mar 14, 2017 8:03 pm    Post subject:
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: 14
Location: Gurgaon

PostPosted: Tue Mar 14, 2017 8:03 pm    Post subject: Reply to: Updating a VSAM file with DISP=OLD
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: 755
Location: Germany

PostPosted: Wed Mar 15, 2017 2:18 pm    Post subject:
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: 14
Location: Gurgaon

PostPosted: Wed Mar 15, 2017 4:25 pm    Post subject: Reply to: Updating a VSAM file with DISP=OLD
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: 755
Location: Germany

PostPosted: Wed Mar 15, 2017 5:43 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us