View previous topic :: View next topic |
Author |
Message |
nagarajan.dharani Beginner
Joined: 04 Apr 2007 Posts: 20 Topics: 4
|
Posted: Mon Jan 14, 2008 2:40 am Post subject: Remove records if duplicate occurs more than once |
|
|
Hi,
Can anyone help me one in the following requirement.
I've a fixed length record file with a employee number as one of the fields.
I need to do a sort and remove the duplicate records if the employee number occurs more than 2 times in the input file.
Is this possible through DFSORT?
For example
INPUT FILE:
88888
88888
77777
88888
77777
66666
My output should be
77777
77777
66666
The employee 88888 had occurred 3 times so the number should be removed.
Thanks,
Dharani |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Mon Jan 14, 2008 4:58 am Post subject: |
|
|
do you want it sorted decending or ascending? What is your record length? what position is your employee number? and what data format? _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
Arunprasad.K Beginner
Joined: 18 Jan 2006 Posts: 18 Topics: 5 Location: Chennai, India
|
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
|
Posted: Mon Jan 14, 2008 11:15 am Post subject: |
|
|
nagarajan.dharani,
The following DFSORT/ICETOOL JCL will give you the desired results.
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
88888
88888
77777
88888
77777
66666
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(01,5,CH) LOWER(3)
//*
|
Hope this helps...
Cheers _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
ranga_subham Intermediate
Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Tue Jan 29, 2008 7:07 am Post subject: |
|
|
this is really helpful.....
Can we know more about the Lower(3) option?
Thanks. _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
|
vkphani Intermediate
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Tue Jan 29, 2008 7:27 am Post subject: |
|
|
ranga_subham wrote: | this is really helpful.....
Can we know more about the Lower(3) option?
Thanks. |
LOWER - only keep records with values that occur less than a specified number of times.
LOWER(3) gives the below values in the code given by kolusu.
66666
77777
77777 |
|
Back to top |
|
|
ranga_subham Intermediate
Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Tue Jan 29, 2008 7:55 am Post subject: |
|
|
Thanks vkphani. _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Tue Jan 29, 2008 11:01 am Post subject: |
|
|
Quote: | Can we know more about the Lower(3) option? |
For complete details on all of the functions available with the SELECT operator of DFSORT's ICETOOL, see:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.11?DT=20060615185603
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:
www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
ranga_subham Intermediate
Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Thu Jan 31, 2008 5:40 am Post subject: |
|
|
Thanks Frank. _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
|
|
|