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

Removal of duplicates


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

New User


Joined: 31 Oct 2006
Posts: 48
Location: Chennai

PostPosted: Fri Apr 13, 2007 12:45 am
Reply with quote

Hi,

My input file is a FB of LRECL 1500.

The key of the file is a 31-length character, starting from position 1.

At position 208, i have a date field of format DDMMYYYY.

There can be more than 1 record with the same key, but different date.

Ex:
Key1.....20122006
Key2.....21122006
Key2.....27122006
Key2.....18122006
Key2.....26122006

My requirement is I need only one record per Key and with the highest Date, in the output.

Please help.

Thanks,
OP
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: Fri Apr 13, 2007 1:33 am
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file (FB/1500)
//OUT DD DSN=...  output file (FB/1500)
//TOOLIN   DD    *
SELECT FROM(IN) TO(OUT) ON(1,31,CH) FIRST USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(1,31,CH,A,214,4,CH,D,210,2,CH,D,208,2,CH,D)
/*
Back to top
View user's profile Send private message
op

New User


Joined: 31 Oct 2006
Posts: 48
Location: Chennai

PostPosted: Fri Apr 13, 2007 3:12 am
Reply with quote

Thanks a lot
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 Removal of date value records DFSORT/ICETOOL 12
No new posts How to remove block of duplicates DFSORT/ICETOOL 8
This topic is locked: you cannot edit posts or make replies. Compare files with duplicates in one ... DFSORT/ICETOOL 11
No new posts CSA Storage Key Removal IMS DB/DC 0
No new posts Merging 2 files but ignore duplicate... DFSORT/ICETOOL 1
Search our Forums:

Back to Top