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
 

 

How to update the sequence of record by using readnext

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
Gopalakrishnan V

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Wed Sep 26, 2012 8:21 pm    Post subject: How to update the sequence of record by using readnext
Reply with quote

Hi,
My VSAM KSDS file record key will be like this,

001000A
001000B
001000C
......
002000A

I need to update the record which having 001 as first 3 byte. If i use read update and rewrite, each time i should pass full key. Is it possible to write with readnext update and rewrite.....since rewrite need full key instead of partial key..

Please correct me if my understanding wrong...

Thanks in advance.
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Sep 26, 2012 9:54 pm    Post subject: Reply to: How to update the sequence of record by using read
Reply with quote

Unless your VSAM is using RLS (Record Level Sharing), you must never issue a READNEXT, READ for UPDATE, REWRITE and a READNEXT.

If you don't ENDBR and then STARTBR/RESETBR afterwards, your CRP (Current Record Pointer) will have lost its mind and VSAM won't know what his true CRP actually is.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7996
Location: Bellevue, IA

PostPosted: Wed Sep 26, 2012 10:01 pm    Post subject:
Reply with quote

Quote:
I need to update the record which having 001 as first 3 byte.
Since you have THREE records listed with 001 in the first 3 bytes, you cannot do any update on a VSAM file using only the first three bytes of the key. An update must be done to only a single record at a time.

As Bill said, save the full key of the record you want to update, end the browse, read the full key for update, rewrite it, then start a new browse.
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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