Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us