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

Handling Duplicate record in VSAM KSDS


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

New User


Joined: 18 Apr 2008
Posts: 1
Location: chennai

PostPosted: Wed Feb 04, 2009 2:39 pm
Reply with quote

How to handle duplicate record in VSAM KSDS while accessing the file Dynamically.


Iam using the below code, but some how iam getting the duplicate records.

IF BCTEMP-FILE-STATUS EQUAL TO 0 AND
BCTEMP-REC-KEY EQUAL TO W-TEMP-ACCT-REC
CONTINUE
ELSE
DISPLAY 'TEMP-FILE-STATUS:' BCTEMP-FILE-STATUS
MOVE W-TEMP-ACCT-REC TO BCTEMP-RECORD
WRITE BCTEMP-RECORD
SET S-ACCT-GENERATED-Y TO TRUE
END-IF
Back to top
View user's profile Send private message
Debabrata Pruseth

New User


Joined: 11 Dec 2008
Posts: 59
Location: Pune , India

PostPosted: Wed Feb 04, 2009 3:03 pm
Reply with quote

Well i doubt VSAM KSDS will have duplicate key and duplicate record . Unless it has a Alternate Key ( With alternate index defined with parameter NONUNIQUEKEY ) and you are referring this alternate key. A simple suggestion will be to have the output file in a FFB and then remove the duplicate records ( having duplicate key ) with SORT and then REPRO to a VSAM file . A similar thing can be done in the Input file also otherwise. That however depends upon your requirement.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Feb 04, 2009 3:12 pm
Reply with quote

Please show the error messages that state a duplicate record is present
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 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 Duplicate transid's declared using CEDA CICS 3
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top