Hi I need to compare two files using SORT utility like...
File 1
id some- acc.no time date some fields..
1 sdbskafjo 456 12 12302009 nejfirejt
2 narjweop 678 dfngijreo
File2
3 nwerjieo 456 12 12302009 eitjertrro
4 sfeijwerf 678 34 10202009 nkewrewe
Now I want the o/p as..
1 3
Here we have to consider composite key like..acc.no+time+date
If these 3 fields are same in two files then I need the acc.no of those two perticular records from two files in third file...
Need Immediate respone pls.....need to finish by 2mr
Need to compare two files using sort in jcl
Moderators: Frank Yaeger, DikDude, Moderator Group
-
- Member
- Posts: 1
- Joined: Thu Feb 18, 2010 6:53 pm
Re: Need to compare two files using sort in jcl
If you need an immediate response , you need to do a better job of providing more detailsmanjeera.bonakurthi wrote:Need Immediate respone pls.....need to finish by 2mr
1. what is the LRECL and RECFM of file1
2. what is the LRECL and RECFM of file2
3. What is the position and format of the composite key in file1
4. What is the position and format of the composite key in file2
5. Does file-1 has duplicates based on the composite key?
6. Does file-2 has duplicates based on the composite key?
7. What is the LRECL and RECFM of output file?
8. Post ALL the rules need for matching
-
- Member
- Posts: 25
- Joined: Tue Apr 28, 2009 10:53 pm
- Location: USA
- Contact:
Based on the information provided, here is a SyncSort for z/OS job that will do what you asked:
Code: Select all
//STEP1 EXEC PGM=SORT
//SORTJNF1 DD *
1 SDBSKAFJO 456 12 12302009 NEJFIREJT
2 NARJWEOP 678 DFNGIJREO
//SORTJNF2 DD *
3 NWERJIEO 456 12 12302009 EITJERTRRO
4 SFEIJWERF 678 34 10202009 NKEWREWE
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(13,3,A,17,2,A,20,8,A)
JOINKEYS FILE=F2,FIELDS=(13,3,A,17,2,A,20,8,A)
REFORMAT FIELDS=(F1:1,2,F2:1,2)
SORT FIELDS=COPY
/*
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
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page