how to delete the same records during sorting



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

how to delete the same records during sorting

Postby lxw039 » Wed Jun 10, 2009 10:18 am

Hi,my friends

I use JCL read a dataset and sort by bn. get the records lis, each record have following fields:
bn
address
name
....

if bn is the same in following reading, we will skip the record. my means just keep unique bn record, don't repeat record that bn is the same. do you have some good idea? I'm very appreciate if yu have sample code for that.

thank you very much!
lxw039
 
Posts: 47
Joined: Tue Oct 07, 2008 11:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to delete the same records during sorting

Postby Bill Dennis » Wed Jun 10, 2009 8:57 pm

To drop duplicate bn when you sort, add

 
   SUM FIELDS=NONE
Regards,

Bill Dennis

Disclaimer: My comments on this forum are my own and do not represent the opinions or suggestions of any other person or business entity.
Bill Dennis
 
Posts: 278
Joined: Thu May 15, 2008 9:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to delete the same records during sorting

Postby Irene Ioujanina » Fri Jul 10, 2009 12:04 am

Hello. I migth not inderstand the problem corectly, but if you don't have the key value in every record, the following post from Feb 17, 2009 12:28 pm will expalin how to eliminate duplicate records:

"Delete duplicate headers and keep group records"
by Irene Ioujanina » Tue Feb 17, 2009 12:28 pm

Hope it helps :)
Irene Ioujanina
 
Posts: 27
Joined: Thu Feb 21, 2008 6:42 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to delete the same records during sorting

Postby Frank Yaeger » Fri Jul 10, 2009 1:11 am

You can do that kind of thing easily with an ICETOOL job like this:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(p,m,f) FIRST
/*


where p,m,f is the starting position, length and format of the bn (the key). For example, if bn is a character field in positions 1-5, you would use ON(1,5,CH).

If that doesn't help, then be more specific about what you want to do and show an example of input records and expected output records.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post