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

Mutiple users updating the same dataset


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vidyaa

New User


Joined: 02 May 2008
Posts: 77
Location: chennai

PostPosted: Fri Aug 29, 2008 11:53 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Aug 29, 2008 12:21 pm
Reply with quote

Have you checked out DISP=MOD in the JCL manual
Back to top
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Fri Aug 29, 2008 6:04 pm
Reply with quote

this is in REXX any way i have used MOD only but then too we have this problem
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Aug 29, 2008 6:07 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 29, 2008 9:08 pm
Reply with quote

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
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Mon Sep 01, 2008 10:19 am
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Sep 01, 2008 11:35 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Mon Sep 01, 2008 9:51 pm
Reply with quote

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
View user's profile Send private message
Adrian Stern

New User


Joined: 13 Feb 2008
Posts: 12
Location: Sweden

PostPosted: Mon Sep 08, 2008 4:46 pm
Reply with quote

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
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts IBM OnDemand Folders displaying to al... IBM Tools 6
Search our Forums:

Back to Top