Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us