Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Retain unique records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 67
Location: 125.16.180.5

PostPosted: Fri Jan 08, 2010 8:46 pm    Post subject: Retain unique records
Reply with quote

Hi,

My requirement is to retain the unique records in a file, not just removing the more than one occurence of record.

My input would be like
Code:

aaaa
aaaa
bbbb
cccc
ffffff


and would like to have the output file as
Code:

bbbb
cccc
ffffff



could some one please explain me how to do that using a syncsort job.

Thanks!!
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jan 08, 2010 11:13 pm    Post subject:
Reply with quote

You can use a DFSORT/ICETOOL job like the following to do what you asked for:

Code:

//S1   EXEC  PGM=ICETOOL                     
//TOOLMSG   DD  SYSOUT=*                     
//DFSMSG    DD  SYSOUT=*                     
//IN DD *                                     
aaaa                                         
aaaa                                         
bbbb                                         
cccc                                         
ffffff                                       
//OUT DD SYSOUT=*                             
//TOOLIN DD *                                 
SELECT FROM(IN) TO(OUT) ON(1,10,CH) NODUPS   
/*
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Sat Jan 09, 2010 2:49 am    Post subject:
Reply with quote

Here is a SyncSort for z/OS job that will produce the requested output:
Code:
//SORT  EXEC PGM=SORT
//SYSOUT  DD SYSOUT=*                             
//SORTOUT DD SYSOUT=*                               
//SORTIN  DD *                                       
AAAA                                                 
AAAA                                                 
BBBB                                                 
CCCC                                                 
FFFFFF                           
//SYSIN   DD *                                       
   INREC FIELDS=(1:C'001',1,80)                     
   SORT FIELDS=(4,6,CH,A),EQUALS                     
   SUM FIELDS=(1,3,ZD)                               
   OUTFIL OUTREC=(1:4,80),INCLUDE=(1,3,CH,EQ,C'001')
/*     
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 67
Location: 125.16.180.5

PostPosted: Sat Jan 09, 2010 4:36 am    Post subject: Reply to: Retain unique records
Reply with quote

Thank you so much frank and Alissa !!, it was helpful.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us