MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Alternate to 'Read with Update and rewrite'

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri Sep 17, 2004 4:35 am    Post subject: Alternate to 'Read with Update and rewrite' Reply with quote

normally we got to do READ with UPDATE before REWRITE.Is there any other way to LOCK the record and directly REWRITE it.why i have to READ a record- is that the only way to make sure that it is available,what if i know that the file is available.Pls show me a the other way.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Sep 17, 2004 4:50 am    Post subject: Reply with quote

vak225,

You need to tell us the environment you are trying to rewrite. Is it in Batch cobol or CICS?

You cannot update a record directly without reading it, unless you are talking of updating a record in a DB2 table.

If you are trying to update a record in a file, then just code DISP=OLD in the JCL and the file will be available ONLY for your application. CICS has an exclusive control of the vsam files, so it is like coding DISP=OLD in batch environment.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri Sep 17, 2004 5:53 am    Post subject: Reply with quote

kolusu,
The Environment : CICS
When i got all the necessay details for updating a record whats the necessary for reading it, before updation.
As far as I know we have to read a record before updation.
Direct rewrite should be faster and efficient.when Direct delete is possible why can't direct REWRITE??? Rolling Eyes Question
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Fri Sep 17, 2004 6:50 am    Post subject: Reply with quote

kolusu,
I forgot to mention that Iam using KSDS dataset.
Back to top
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Mon Sep 20, 2004 1:09 am    Post subject: Reply with quote

You must be sure that the record that you are going to update has not been changed before updating it - if you do not prevent access to the record before processing it then someone may update it before you do and then your update will destroy the previous update - that is why you must read and lock the record and then update it. The usual process is you read the record, display it for alterations, read it again and log it and check if it has been modified since the last read (check if somebody else has updated it), then update it.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group