Extract records by comparing files



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Re: Extract records by comparing files

Postby skolusu » Tue Jul 27, 2010 11:45 pm

MFsys,

It would have helped if you are clear with your requirements. Here is an updated DFSORT/ICETOOL JCL which will give you the desired results . I eliminated the duplicate records from file1 just based on the Dataset name.

//STEP0100 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//FB50     DD DSN=Your input1 FB 50 byte file,DISP=SHR
//TM96     DD DSN=&&TM96,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)   
//FB96     DD DSN=Your input2 FB 96 byte file,DISP=SHR
//         DD DSN=&&TM96,DISP=SHR,VOL=REF=*.TM96               
//OUT      DD SYSOUT=*                                         
//TOOLIN   DD *                                                 
  SORT FROM(FB50) USING(CTL1)                                   
  SPLICE FROM(FB96) TO(OUT) ON(13,44,CH) WITH(1,3) USING(CTL2) 
//CTL1CNTL DD *                                                 
  SORT FIELDS=(6,44,CH,A),EQUALS                               
   SUM FIELDS=NONE                                             
  OUTFIL FNAMES=TM96,BUILD=(1,3,13:6,44,96:X)                   
//CTL2CNTL DD *                                                 
  OUTFIL FNAMES=OUT,                                           
  BUILD=(01,03,        $ FILE-1 FIELD-1                         
         3X,           $ 3 BLANKS                               
         13,44,        $ DATASET NAME                           
         3X,           $ 3 BLANKS                               
         04,06,        $ FILE-2 FIELD-1                         
         3X,           $ 3 BLANKS                               
         60,10,        $ FILE-2 FIELD-3                         
         3X,           $ 3 BLANKS                               
         73,10,        $ FILE-2 FIELD-4                         
         3X,           $ 3 BLANKS                               
         86,05,        $ FILE-2 FIELD-5                         
         4X,           $ 3 BLANKS                               
         95,02)        $ FILE-2 FIELD-6                         
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Extract records by comparing files

Postby MFsys » Fri Jul 30, 2010 12:54 am

Thanks, skolusu. I checked your reply today only and have just tested it. It does produce the output the way I like it, thanks for that :). Though, there is still some more work which I would need to do due to some other aspects that I had overlooked earlier the solution you have provided would greatly help.
MFsys
 
Posts: 9
Joined: Thu Jul 22, 2010 4:58 pm
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post