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

How to update the sequence of record by using readnext


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Sep 26, 2012 9:54 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Sep 26, 2012 10:01 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top