|
|
| Author |
Message |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6726 Location: 221 B Baker St
|
|
|
|
Hello,
Attached to this "sticky" is a small sample program that matches/merges 2 sequential files that have been previously put "in sequence".
Depending on your exact requirement, changes may need to be made, but the overall process works for most cases. If your files have a 1-to-1 or a 1-to-many relationship, the model should work for you. One case where additional code may be needed is when both files might have duplicate key values. The issue may be how to determine how the duplicates should "sync up".
Something to keep in mind is that to keep things more manageable you do not want to code compares for multiple keys. As you read records (before any comparing) combine the "key" fields into a ws field (one for each file) so the compare does not become other than simple.
If you find a typo or a "real" error, please let me know via PM. If you prefer a different way, fine, but this is an approach that works many, many places.
I cannot emphasize enough that it is critical that you thoroughly test your version of the code before production implementation. |
|
| Back to top |
|
 |
References
|
Posted: Tue Jul 10, 2007 9:12 pm Post subject: Re: 2-File Match/Merge sample code |
 |
|
|
 |
Purnendu.it
New User
Joined: 11 May 2007 Posts: 32 Location: chennai
|
|
|
|
Hi dick,
I want to inform you that the code you have is not coming in proper alignment after download.
Please can you send it in a proper alignment
Thanks in advance,
Purnendu. |
|
| Back to top |
|
 |
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 1088 Location: At my desk
|
|
|
|
| I sometimes find that if you just save the unopened file to your PC before opening it, everything will align properly....Something about how the browser sees a txt file and how notepad sees that same file.... |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6726 Location: 221 B Baker St
|
|
|
|
Hello Purnendu,
As CG suggests, saving the file to your local drive will "clean it up".
Many of the attached text files do not open properly in browser windows.
Please let us know if it doesn't open properly after you right-click/save as. |
|
| Back to top |
|
 |
Purnendu.it
New User
Joined: 11 May 2007 Posts: 32 Location: chennai
|
|
|
|
HI dick,
Yes its working properly.When i was downloading it was
having improper alignment but after i tried as you suggested its perfectly
alright.
Thanks |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6726 Location: 221 B Baker St
|
|
|
|
You're welcome
Thanks for letting us know that it worked for you. |
|
| Back to top |
|
 |
|
|