View previous topic :: View next topic
|
Author |
Message |
nagajyothi
New User
Joined: 01 Jun 2007 Posts: 3 Location: UK
|
|
|
|
Hi all,
Can you please tell me whether a search is possible in sequential depending upon a specific field?
For eg I have field 'account num' I need to search a flat file for this field and after this field is found, then find matching record in 2nd file and write corresponding record to another file.
Please let me know how this functionality can be implemented usign cobol pgm? |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi Nagajyothi,
I understood that U have 3 files.
First : Here we need to search the occurance of the Account Number.
Second: If it exists then find the existance of the record with the same Account number in this file.
Third: If it exists in the second file then process that record and then write it into the third file.
I hope this is ur requirement.
Follow these steps
Step1: To search the occurance of the Account number in the Flat file then read the recods in the file sequentially and until u find the account number or End-of-file is reached.
Step2: If u find the Accoun Number then follow the same procedure in for the second file and get the matched record from the second file.
Step3: Process the record and then write into the Third file. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Or you could use DFSORT which is good for things like that. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
How many different account numbers will be processed in a single execution?
The answer to that may determine which approach you use. There are multiple ways to do what you posted (if i understood the requirement correctly). |
|
Back to top |
|
|
Raphael Bacay
New User
Joined: 04 May 2007 Posts: 58 Location: Manila, Philippines
|
|
|
|
Hello,
You can implement mkk157 pseudocode but sort first and second files first so that everything can be done in 1 pass and to make everything more efficient.
Regards. |
|
Back to top |
|
|
|