SORT COMPARE 2 VOLUME FILES

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
SRI123
Member
Posts: 15
Joined: Wed Aug 12, 2009 12:18 pm

SORT COMPARE 2 VOLUME FILES

Post by SRI123 » Wed Aug 12, 2009 3:57 pm

Hello,

I have two files each having 50mn records. I want to compare these two, but out put should contain only the mismatch records. Can some one suggest a way?

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Wed Aug 12, 2009 8:25 pm

Take a look at the methods described in the "Create files with matching and non-matching records" Smart DFSORT Trick at:

http://www.ibm.com/support/docview.wss? ... g3T7000094

If you need more specific help, please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

SRI123
Member
Posts: 15
Joined: Wed Aug 12, 2009 12:18 pm

Post by SRI123 » Thu Aug 13, 2009 11:37 am

I read the link, but I didnt get the exact scenario which I want.

My requirement is like this:
File1 has the 10mn records with length of 50 bytes FB. Due to some problem in the input file, I created the file again as File2. And there are no duplicates in the file.

1.Now I want to know the records that are not matching from File2 to File1.

FILE1:
AAAA123BBBB
BBBB456CDEF
CCCC567DEF

File2:
AAAA103BBBB
BBBB456CDEF
CCCC568DEFG

Output should contain:
AAAA103BBBB
CCCC568DEFG

2.And Is it possible to get only the mismatch data in that position from File2 to File1 like this
0
8

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Thu Aug 13, 2009 8:45 pm

Here's a DFSORT/ICETOOL job that will do what you asked for in 1. DFSORT does not have any built-in features to do 2.

Code: Select all

//S1   EXEC  PGM=ICETOOL                                           
//TOOLMSG   DD  SYSOUT=*                                           
//DFSMSG    DD  SYSOUT=*                                           
//IN1 DD DSN=&&I1,DISP=(OLD,PASS)                                  
//IN2 DD DSN=&&I2,DISP=(OLD,PASS)                                  
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)      
//OUT DD SYSOUT=*                                                  
//TOOLIN DD *                                                      
COPY FROM(IN1) TO(T1) USING(CTL1)                                  
COPY FROM(IN2) TO(T1) USING(CTL2)                                  
SELECT FROM(T1) TO(OUT) ON(1,50,CH) NODUPS USING(CTL3)             
//CTL1CNTL DD *                                                    
  INREC OVERLAY=(51:C'1')                                          
//CTL2CNTL DD *                                                    
  INREC OVERLAY=(51:C'2')                                          
//CTL3CNTL DD *                                                    
  OUTFIL FNAMES=OUT,INCLUDE=(51,1,CH,EQ,C'2'),BUILD=(1,50)         
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others