IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Retain unique records


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Fri Jan 08, 2010 8:46 pm
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 Developer


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

PostPosted: Fri Jan 08, 2010 11:13 pm
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: 496
Location: USA

PostPosted: Sat Jan 09, 2010 2:49 am
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: 69
Location: 125.16.180.5

PostPosted: Sat Jan 09, 2010 4:36 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top