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

Extract duplicates using dfsort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srajanbose

New User


Joined: 11 Oct 2004
Posts: 69
Location: chennai

PostPosted: Fri Oct 31, 2008 3:44 pm
Reply with quote

Below is my input file
Code:
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  ZVMINI1   
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  ZZ       
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRUD;  ZZ       
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  ZZZ       
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRUD;  ZZZZ     
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRUD;  Z1       
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  Z1       
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLSEX0D;  Z1       
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  Z2       
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  Z3       
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  Z4       
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLSEX0D;  Z5       
I want my output file as
Code:
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  ZZ
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRUD;  ZZ
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRUD;  Z1
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  Z1
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLSEX0D;  Z1
How to acheive this using dfsort.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Oct 31, 2008 8:05 pm
Reply with quote

Assuming you are matching on bytes 54 for length of 8 in FB records, the following will do the trick

Code:
//TOOL EXEC PGM=ICETOOL                                             
//TOOLMSG DD SYSOUT=*                                               
//DFSMSG  DD SYSOUT=*                                               
//SRCE    DD *                                                     
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  ZVMINI1       
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  ZZ             
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRUD;  ZZ             
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  ZZZ           
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRUD;  ZZZZ           
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRUD;  Z1             
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  Z1             
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLSEX0D;  Z1             
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  Z2             
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  Z3             
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  Z4             
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLSEX0D;  Z5             
/*                                                                 
//TARG DD SYSOUT=*                                 
//TOOLIN  DD *                                     
 SELECT FROM(SRCE) TO(TARG) ON(54,8,CH) ALLDUPS   
/*                                                 


My TARG sysout shows


Code:
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  ZZ   
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRUD;  ZZ   
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRUD;  Z1   
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLDPRRD;  Z1   
APV;DPR;OR7SQE.PFI.L03.D250608.DPR.DPR.RPL.RLSEX0D;  Z1   


Garry.
Back to top
View user's profile Send private message
srajanbose

New User


Joined: 11 Oct 2004
Posts: 69
Location: chennai

PostPosted: Tue Nov 04, 2008 9:27 am
Reply with quote

Thanks a lot Garry.It works fine.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top