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

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


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Finding and researching jobs All Other Mainframe Topics 0
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top