View previous topic :: View next topic
|
Author |
Message |
Gopalakrishnan V
Active User
Joined: 28 Jun 2010 Posts: 102 Location: chennai
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
|