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
 

 

Finding non matched records b/w 2 files with duplicate keys

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sri_code

New User


Joined: 20 Nov 2006
Posts: 19
Location: india

PostPosted: Mon Oct 19, 2009 8:35 pm    Post subject: Finding non matched records b/w 2 files with duplicate keys
Reply with quote

Hi,

I have 2 files same layout (both having duplicate keys)
i want to remove the records from file1 where the key matches with the second file file2

File1: (contins duplicate keys)
LRECL = 500, FB, Key length: 15bytes (from column 12 to 26)

40020020729061999000000807868176294RC0
40020020729061999000000806868176295RC0
40020020729061999000000806868176294RC0
40020020729061999000000428868176294RC0
40020020729061999000000428868176295RC0
40020020729061999000000424868176294RC0

File2: (contins duplicate keys)
LRECL = 500, FB, Key length: 15bytes (from column 12 to 26)

40020020729061999000000807868176294RC0
40020020729061999000000807868176295RC0
40020020729061999000000806868176295RC0

output file:
40020020729061999000000428868176294RC0
40020020729061999000000428868176295RC0
40020020729061999000000424868176294RC0

Can anybody help me in solving this, this is very urgent for me.
Thanks in advance.
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Oct 19, 2009 9:00 pm    Post subject: Reply to: Finding non matched records b/w 2 files with dupli
Reply with quote

sri_code,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                       
//SORTOUT  DD DSN=&&HD,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)             
//SYSIN    DD *                                                       
  SORT FIELDS=COPY                                                     
  OUTFIL REMOVECC,NODETAIL,BUILD=(500X),TRAILER1=(12:C'HDR')           
/*                                                                     
//STEP0200 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=&&HD,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT             
//         DD DSN=your 2nd file,DISP=SHR
//         DD DSN=&&HD,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT             
//         DD DSN=your file which you need to extract,DISP=SHR
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(12,3,CH,EQ,C'HDR'),PUSH=(501:ID=1)) 
  SORT FIELDS=(12,16,CH,A),EQUALS                                     
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(503:SEQNUM,8,ZD,RESTART=(12,16))),
  IFTHEN=(WHEN=GROUP,BEGIN=(503,8,ZD,EQ,1),PUSH=(502:501,1))           
                                                                       
  OUTFIL INCLUDE=(501,2,ZD,EQ,22),BUILD=(1,500)                       
/*                                                             
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


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