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 - Get Unique Records from a File

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> JCL/SORT
View previous topic :: View next topic  
Author Message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Dec 01, 2005 9:00 am    Post subject: SORT - Get Unique Records from a File Reply with quote

How do I extract only Unique records from a dataset ?

This is often confused with "Eliminating Duplicates" from a dataset. Unique records are those which have only one occurrence in the file. Eliminating Duplicates will write both "Unique records" + "First instance of a duplicate" to the output.

The simplest way to extract Unique records is to use DFSORT's ICETOOL or Syncsort's SYNCTOOL

Code:

//*------------------------------------------------------*
//* Change the PGM to SYNCTOOL if you are using SYNCSORT *
//*------------------------------------------------------*
//R010   EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN       DD DSN=my.input.file,DISP=SHR
//OUT      DD DSN=my.output.file.unique,DISP=OLD
//TOOLIN   DD *
 SELECT FROM(IN) TO(OUT) ON(1,50,CH)  NODUPS
/*


Thanks,
Phantom
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Thu Dec 01, 2005 9:13 am    Post subject: Reply with quote

Solution # 2: Using SORT
http://www.mvsforums.com/helpboards/viewtopic.php?p=714#714
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 -> JCL/SORT 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