View previous topic :: View next topic
|
Author |
Message |
vidyaa
New User
Joined: 02 May 2008 Posts: 77 Location: chennai
|
|
|
|
Hi Friends,
is there any way that multiple users can update on the same datset set at the same time without getting the contention.
am using
"ALLOC FI(OUTX) DA('"OUTDS"') MOD REUSE"
your suggestions please |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Have you checked out DISP=MOD in the JCL manual |
|
Back to top |
|
|
malathy_tv
New User
Joined: 29 May 2007 Posts: 34 Location: chennai
|
|
|
|
this is in REXX any way i have used MOD only but then too we have this problem |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Well, you have not expressed that there is a problem, merely asking a question.
REXX, JCL - the result is the same when you specify a disposition, that is why I referred you to the JCL manual.
So if you actually do have a problem - would you care to explain it for us to look at. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
i have used MOD only but then too we have this problem |
Is your problem that only one user can access the dataset at a time?
This is not a problem - it is the way MOD is designed to work.
If you explain why multiple people need to update the dataset at the same time, we may be able to offer suggestions. |
|
Back to top |
|
|
malathy_tv
New User
Joined: 29 May 2007 Posts: 34 Location: chennai
|
|
|
|
actually i have written a rexx which needs to get input from the user and update in an output file along with the request number.for first user request one, second one request two and so on.
so when more than one user try entering values for the output file gets the contention message and the second request number gets the request number one actually it needs to be two |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
I'm not a REXX expert, however, I do play with files in batch. It's not good to use a single file across JOBs for such a taks described in this thread - what if two user enter the same "request number" at a given moment..?
If MOD is used & if the data set already existed - new records will be added to the end of the data set (for sequential files only), but it would take the "exclusive rights" of the DSN, when "one" is updating "other" can't, as told before- it is the way MOD is designed to work. Would suggest to use temparary files in different JOBs & then on "final" processing merge them daily..only a thought though- I don't know your requirement fully. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
How many users will there be? How many records will there be? Some designs will work on a small scale, but may not hold up when scaled to larger numbers. n a small scale, I think MOD will work.
1. the user types information / fills out screen / whatever, then presses Enter.
2. allocate file with MOD. If someone already has file allocated and the allocation fails, then wait 1 second and retry.
3. count number of existing records
4. write new record, using count+1
5. free the file immediately.
You can probably test your scheme with several batch jobs that sleep for random intervals, and that go through steps 2-5.
For a larger scale, use a VSAM dataset instead. |
|
Back to top |
|
|
Adrian Stern
New User
Joined: 13 Feb 2008 Posts: 12 Location: Sweden
|
|
|
|
1 Create a started task to control your file
2 Let the rexx program pass the information to the started task
3 Contention disappears as started task is sole user of your file
4 Requests to be queued
Adrian |
|
Back to top |
|
|
|