Hi All,
I am at initial stage of easitrieve. I have three files A,B,C.I want to match file A with file B on tran-id field and have to put matched records in OUTFILE1.Similarly I want to match file C with A on tran-id and put matched records in OUTFILE2.finaly i want unmatched records from filles A,B,C into OUTFILE3
thank,
Jeevan Jadhav
comparing two files on some fields
Moderators: DikDude, Moderator Group
EAZYTRIEVE FILE MATCHING
You can use IF MATCHED command to do this.
Make sure files are sorted on tran-id before running this code.
Logic of above code may need to change, according to details of your requirement.
Code: Select all
JOB INPUT (FILEA KEY(TRAN-IDA) +
FILEB KEY(TRAN-IDB) +
FILEC KEY(TRAN-IDC) )
IF MATCHED FILEA FILEB
WRITE to OUTFILE1
ELSE
WRITE to exception file.
END-IF
IF MATCHED FILEA FILEC
WRITE to OUTFILE2
ELSE
WRITE to exception file.
END-IF
....
....
Logic of above code may need to change, according to details of your requirement.
Natarajan
Chennai
Chennai
EAZYTRIEVE file matching
YES, there are more chances that you will write duplicate records into outputfile. Instead of write so much logic in the program to handle this. Using sort remove duplicates from exception file.
If it is not feasible, do let us know, we can work on to implement the logic for that.
First make sure, file A does not contain any duplicates. If it contain duplicates
program logic will become complex. since it is the driver file.
If it is not feasible, do let us know, we can work on to implement the logic for that.
First make sure, file A does not contain any duplicates. If it contain duplicates
program logic will become complex. since it is the driver file.
Natarajan
Chennai
Chennai
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