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
 
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 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 FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm

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