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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: checking for existence of key and to write/rewrite into KSDS
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

Site Director


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

PostPosted: Thu Oct 16, 2008 1:03 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Oct 16, 2008 8:05 pm    Post subject:
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 Moderator


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

PostPosted: Thu Oct 16, 2008 10:47 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts Reasonable way of checking wildcards ... sergeyken CLIST & REXX 5 Wed Sep 07, 2016 8:43 pm
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm


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