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 

VSAM error code 21

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Data Management
View previous topic :: View next topic  
Author Message
suma
Beginner


Joined: 23 Jan 2006
Posts: 65
Topics: 29

PostPosted: Thu Nov 29, 2007 3:43 am    Post subject: VSAM error code 21 Reply with quote

I am getting VSAM error code of 21 when I am trying to append the records to the existing VSAM file.

"21----- Sequentially accessed files only. Indicates a sequence error. The ascending key requirements of successive record key values has been violated, or, the prime record key value has been changed by a COBOL program between successful execution of a READ statement and execution of the next REWRITE statement for that file. "

Is there any method to append records into the VSAM file....when there exists records in the file?



thanks
Suma
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Thu Nov 29, 2007 4:28 am    Post subject: Reply with quote

suma,

Quote:

am getting VSAM error code of 21 when I am trying to append the records to the existing VSAM file.


Can you show us how are u trying to append the records to the VSAM file? ALso show us how u have specified the access method for the same.

You need to specify ACCESS IS SEQUENTIAL for the VSAM file and you need to open the VSAM in OUTPUT mode. Having done this, a simple WRITE statement will append the rows to the already existing records.

Hope I am not missing something.
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Thu Nov 29, 2007 4:11 pm    Post subject: Reply with quote

Is your VSAM file a KSDS, ESDS, or RRDS file? Please show a listcat.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Data Management 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