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 

Sort problem

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Beswar
Beginner


Joined: 04 Feb 2003
Posts: 33
Topics: 15

PostPosted: Wed Apr 23, 2003 2:29 pm    Post subject: Sort problem Reply with quote

Hi

Does any body how to remove duplicate records through Sort .

Thanks
Eswar
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: Wed Apr 23, 2003 2:49 pm    Post subject: Reply with quote

Eswar,

If you want to keep non-duplicates and the first record of each set of duplicates, you can do that with the following DFSORT/ICETOOL job:

Code:

//DOIT   EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN   DD DSN=...    input data set
//OUT DD DSN=...   first record with each key
//TOOLIN   DD *
  SELECT FROM(IN) TO(OUT) ON(p,m,f) FIRST
/*


p,m,f is the starting position, length and format of the key (e.g. 11,20,CH).

Besides FIRST, DFSORT's ICETOOL also lets you use LAST, FIRSTDUP, LASTDUP, ALLDUPS, NODUPS, HIGHER(n), LOWER(n), EQUAL(n) and DISCARD(savedd) to do all kinds of other things with duplicates and non-duplicates.

For more information on this, see the "Keep dropped duplicate records (XSUM)" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

For complete information on DFSORT's ICETOOL, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.0?DT=20060615185603

(You can also use SUM FIELDS=NONE to remove duplicates, but ICETOOL's SELECT operator is much more versatile.)
_________________
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


Last edited by Frank Yaeger on Thu Sep 14, 2006 4:33 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Beswar
Beginner


Joined: 04 Feb 2003
Posts: 33
Topics: 15

PostPosted: Wed Apr 23, 2003 2:59 pm    Post subject: Reply with quote

Thank you very much Frank. I tried using sum field= NONE and It worked fine.

But I just want to know How can I find whether I have ICETOOL in our system. becasue we have not used anywhere ICETOOL in our sytem. we use only EXEC PGM=SORT.

Have a Great Day

Thanks
Eswar
Razz
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: Wed Apr 23, 2003 4:23 pm    Post subject: Reply with quote

Eswar,

If you are using DFSORT, then you have ICETOOL. To determine if you're using DFSORT, look at the messages in SYSOUT from your PGM=SORT run. If they start with ICE (e.g. ICE000I), then you have DFSORT and ICETOOL. If they start with WER or anything else, then you don't have DFSORT or ICETOOL.

If you are using DFSORT, try ths DFSORT/ICETOOL job to prove to yourself that you have ICETOOL. (If you use a JOBLIB or STEPLIB to get to DFSORT, use the same JOBLIB or STEPLIB in the ICETOOL job below.)

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
RECORD
/*
//TOOLIN DD *
  COUNT FROM(IN)
/*

_________________
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
Beswar
Beginner


Joined: 04 Feb 2003
Posts: 33
Topics: 15

PostPosted: Wed Apr 23, 2003 8:03 pm    Post subject: Reply with quote

Frank

Thank you very much for your explanation.

Good night

Thanks
Eswar
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 -> Application Programming 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