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

VSAM KSDS write deletes old records


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
morpheus007

New User


Joined: 27 Dec 2005
Posts: 58

PostPosted: Mon May 10, 2010 9:10 pm
Reply with quote

I am trying to write to a VSAM KSDS file but after each run I am just left with only the new records written. The old records are getting wipedoff.Please let me know why this could be happening.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 10, 2010 9:21 pm
Reply with quote

Hello,

What is the SELECT/ASSIGN?

How is the file OPENed?
Back to top
View user's profile Send private message
morpheus007

New User


Joined: 27 Dec 2005
Posts: 58

PostPosted: Mon May 10, 2010 9:34 pm
Reply with quote

SELECT REQUEST-MASTER-FILE ASSIGN TO VXSIREQF
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS RQST-MAIN-KEY
ALTERNATE RECORD KEY IS RQST-ALT1-1
ALTERNATE RECORD KEY IS RQST-ALT2-1
ALTERNATE RECORD KEY IS RQST-ALT3-1
ALTERNATE RECORD KEY IS RQST-ALT4-1
FILE STATUS IS REQUEST-FILE-STATUS.


OPEN OUTPUT REQUEST-MASTER-FILE


WRITE REQUEST-MASTER-REC


KSDS FILE DEFINED WITH SHR(2,3) REUSE NOERASE.

FILE IS LOADED FROM PROD WITH ABOUT 1500 RECS AND THEN I RUN THE JOB . IF THERE ARE ABOUT 10 ADDS I END UP WITH ONLY 10 RECS INSTEAD OF ALL 1100 RECS.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 10, 2010 9:41 pm
Reply with quote

Hello,

Because you opened the file as output?

Suggest you try to open the file as i-o instead. At the top of the page is a link to "IBM Manuals". Look in the COBOL Language Reference for complete info.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue May 11, 2010 11:42 am
Reply with quote

I would also look into ......................
Quote:
REUSE|NOREUSE
Specifies whether or not the cluster can be opened again and again as a reusable cluster.
If REUSE or NOREUSE is specified in the SMS data class, the value defined is used as the data set definition, unless it has been previously defined with an explicitly specified or modeled DEFINE attribute.

REUSE
Specifies that the cluster can be opened again and again as a reusable cluster. When a reusable cluster is opened, its high-used RBA is set to zero if you open it with an access control block that specifies the RESET attribute.
REUSE lets you create an entry-sequenced, key-sequenced, or relative record work file.

When you create a reusable cluster, you cannot build an alternate index to support it. Also, you cannot create a reusable cluster with key ranges (see the KEYRANGE parameter). Reusable data sets can be multivolume and can have up to 123 physical extents.

Restriction: If you select REUSE and your command also contains the keyword UNIQUE, you must remove the UNIQUE keyword or the DEFINE command will be unsuccessful.

Abbreviation: RUS

NOREUSE
Indicates that the cluster cannot be opened again as a new cluster.

Abbreviation: NRUS
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top