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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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