View previous topic :: View next topic
|
Author |
Message |
anand tr
New User
Joined: 12 Aug 2008 Posts: 41 Location: chennai
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What should happen when a key exists on both files? You did not tell us the rules. . . |
|
Back to top |
|
|
anand tr
New User
Joined: 12 Aug 2008 Posts: 41 Location: chennai
|
|
|
|
When the key exists in both the files, the KSDS should be updated.(i.e the latest record should be written) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|