Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Handling Duplicate record in VSAM KSDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Handling Duplicate record in VSAM KSDS
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Feb 04, 2009 3:12 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us