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: 7931
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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm


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