Compare 2 files with Multiple Key

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
tamilthangam
Member
Posts: 1
Joined: Wed Apr 22, 2009 5:48 pm

Compare 2 files with Multiple Key

Post by tamilthangam » Wed Apr 22, 2009 5:58 pm

I have 2 I/p files

F1 - file 1

Length 187
length 24 -32 & 32 - 40 have ACCT NO ( acc 1 (24-31) & acc 2 ( 32-40) ) 40 - 106 Student Details.

F2 - file 2

Length 187
length 24 -32 & 32 - 40 I have ACCT NO 40 - 106 Student Details.

File 1 should be searched with file 2 using acct 1(24-8) along with 40-102
& it should search with acct 2( 32-40) so record no present with any of acct 1 & 2 should be written to File output.
Please help me to write search


I tried
COPYDIFF
KEY1=(24,8,C)
KEY2=(32,8,C)
but it is not searching Key 2 Search.

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 Apr 22, 2009 8:28 pm

Are those COMPAREX control statements? Is that the utility you want to use?
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

Alissa Margulies
Member
Posts: 25
Joined: Tue Apr 28, 2009 10:53 pm
Location: USA
Contact:

Post by Alissa Margulies » Tue Apr 28, 2009 11:03 pm

tamilthangam,

If you have access to SyncSort for z/OS, here is a job that should produce your desired output:

Code: Select all

//STEP1  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTJNF1 DD DSN=input.file1,...
//SORTJFN2 DD DSN=input.file2,...
//SORTOUT  DD DSN=output.noaccts,...
//SYSIN    DD *
   JOINKEYS FILE=F1,FIELDS=(24,8,A,32,8,A)   
   JOINKEYS FILE=F2,FIELDS=(24,8,A,32,8,A)   
   JOIN UNPAIRED,F1,ONLY
   SORT FIELDS=COPY                  
/*
Alissa Margulies
SyncSort Mainframe Product Services
zos_tech@syncsort.com
201-930-8260

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