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

checking for existence of key and to write/rewrite into KSDS


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anand tr

New User


Joined: 12 Aug 2008
Posts: 41
Location: chennai

PostPosted: Thu Oct 16, 2008 11:03 am
Reply with quote

Hi all,
I have a flat file which contains huge records(500-600krecords).I have to copy this into a KSDS .The flat file is being deleted and recreated everyday with fresh data . this is being appended into KSDS everyday(also needs to be updated in case of duplicate key). So during the month end the KSDS will be having the entire months records.
But i just cant use SORT FIELDS=COPY, since the keys might be duplicate.
Can anyone suggest how to include some condition so as to check for existence of key and to write/rewrite the KSDS.
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: Thu Oct 16, 2008 1:03 pm
Reply with quote

Hello,

What should happen when a key exists on both files? You did not tell us the rules. . .
Back to top
View user's profile Send private message
anand tr

New User


Joined: 12 Aug 2008
Posts: 41
Location: chennai

PostPosted: Thu Oct 16, 2008 2:37 pm
Reply with quote

When the key exists in both the files, the KSDS should be updated.(i.e the latest record should be written)
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: Thu Oct 16, 2008 8:05 pm
Reply with quote

Hello,

How many records are already in the vsam file? Is the file growing? If yes, how much per month or quarter?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Oct 16, 2008 10:47 pm
Reply with quote

anand tr,

It's not clear from your description whether the first record of duplicates is the latest record or the last record of duplicates is the latest record.

If you want to keep only the first record of duplicates, you can use ICETOOL's SELECT operator with the FIRST operand. If you want to keep only the last record of duplicates you can use SELECT with LAST.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts rewrite same SAY line CLIST & REXX 8
This topic is locked: you cannot edit posts or make replies. How To Write, Compile and Execute Cob... COBOL Programming 5
Search our Forums:

Back to Top