View previous topic :: View next topic
|
Author |
Message |
soumyanamboo
New User
Joined: 16 Apr 2008 Posts: 13 Location: Chennai
|
|
|
|
hi,
i have a requirement like,
There are 3 i/p files. for each record in the 2 i/p file, i have to read the third file and populate requird fields.
in this case i need to read the 3rd file twice, one read for each file.
How can i optimise the read to 3rd file, since it is master database file. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Is it keyed ? |
|
Back to top |
|
|
soumyanamboo
New User
Joined: 16 Apr 2008 Posts: 13 Location: Chennai
|
|
|
|
ya. we have key field for comparison |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Your definition of your requirement is not clear.
You mention 3 input files, but then say file 3 is "master database file". If "file 3" is a database, you could read file1 and retrieve the needed data from the database. After completing file1, read file2 and retrieve the needed data from the database.
If both file1 and file2 are sorted n the same sequence, you could use a 2-file match/merge and as records are processed get the needed data from the database. This would save some amount of access to the database.
If file3 is not a database, please provide a better description of what you need to do. If you post example data from all 3 data sources and what you want the output to be it will help us help you.
Where does the dynamic array get used? |
|
Back to top |
|
|
soumyanamboo
New User
Joined: 16 Apr 2008 Posts: 13 Location: Chennai
|
|
|
|
I thought of reading the two files and populate to a dynamic array, and read the Database file for each rec in the array.
But instead, i will merge the two files, and sort it based on the key, and read the database file.
That will be sufficient.
Thanks... |
|
Back to top |
|
|
|