View previous topic :: View next topic |
Author |
Message |
babun Beginner
Joined: 03 Aug 2005 Posts: 19 Topics: 9 Location: bangalore
|
Posted: Thu Apr 20, 2006 1:49 am Post subject: Matching logic from 2 files by using Cobol |
|
|
Hi
In Cobol ,Let's assume that we have 2 files.
I need to write the ,matching records from 2files into some other third file?
So when i am using the matching logic(i take first rec in 1st file n read it and compare it with all records of 2nd file ,,so when i am reaching the last record in 2nd file,,how it's going to come for the first record ,,to compare again with the 2nd record in 1st file with all records in 2nd file?)
Regard's
Babun _________________ babu |
|
Back to top |
|
 |
Crox Beginner
Joined: 29 May 2004 Posts: 52 Topics: 9
|
Posted: Thu Apr 20, 2006 2:22 am Post subject: |
|
|
I guess you are studying the balance line standard problem also called Collating. The files should be sorted first and you will certainly not compare one record with all the others.... (just count out how many compares you will do if there are 100 in each, 200, 1000....)
You should study Jackson Structured Programming (JSP) or Volmac Structured Programming (VSP). It is about recognizing groups in your inputfiles and also recognizing when groups are matching and not matching.
In COBOL there are smart ways to combine the ID's for each file in one ID, which also includes the filestatus. In one IF, you should know a lot. |
|
Back to top |
|
 |
hariavinash Beginner
Joined: 21 Jan 2005 Posts: 52 Topics: 7
|
|
Back to top |
|
 |
|
|