MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Remove records if duplicate occurs more than once

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
nagarajan.dharani
Beginner


Joined: 04 Apr 2007
Posts: 20
Topics: 4

PostPosted: Mon Jan 14, 2008 2:40 am    Post subject: Remove records if duplicate occurs more than once Reply with quote

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
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon Jan 14, 2008 4:58 am    Post subject: Reply with quote

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
View user's profile Send private message
Arunprasad.K
Beginner


Joined: 18 Jan 2006
Posts: 18
Topics: 5
Location: Chennai, India

PostPosted: Mon Jan 14, 2008 9:39 am    Post subject: Reply with quote

Dharani,

You can refer the post in the below link and modify to have an IF condition in the FileAid step. Or you can change the DFSORT accordingly


http://www.mvsforums.com/helpboards/viewtopic.php?t=2174&highlight=total+splice

Arun.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Mon Jan 14, 2008 11:15 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Tue Jan 29, 2008 7:07 am    Post subject: Reply with quote

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
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Tue Jan 29, 2008 7:27 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Tue Jan 29, 2008 7:55 am    Post subject: Reply with quote

Thanks vkphani.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Jan 29, 2008 11:01 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Thu Jan 31, 2008 5:40 am    Post subject: Reply with quote

Thanks Frank.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group