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 Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 9 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am

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