View previous topic :: View next topic
|
Author |
Message |
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Think this sample program will be usefull to less experienced programmers. |
Yes, this was to provide compilable/executable pseudo-code for learning - many training centers do not appear to teach/require the students understand this very basic process that is in every application i've ever seen.
Quote: |
But it does not meet most companys standards. Usage of "GO TO", for instance, instruction is not accepted in many companys.
|
Most companies (at least those that are well managed) have backed off of the "no go to" rule. It has been demonstrated many, many times that properly used, there is nothing wrong with a go to.
Most places that have standards concerning the use of "go to" permit this in these situations:
1. To go to the end of a routine (i.e. AT END).
2. To go to the top of a routine.
3. To go to an abend procedure.
One of the reasons for "go to less" programming was so code would be "structured". Unfortunately, no "go to"s does not guarantee well structured code. Another issue we discovered/documented "back then" was that whe programs always ran inside some PERFORMs, system paging was greatly increased.
As far as code is concerned (i've supported very many organizations whose standards greatly differ), i believe code should always work correctly, be maintainable, and not use an excessive amount of system resources. These goals can be accomplished with or without permission/prevention of "go to". |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
if you have never posted You cannot download anything |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
From all these replies, it looks like if the New user who has 0 posts don't see an option to Download until they make their first post on this forum and that is the reason why we see so many replies with same question rolling over many pages...
Admin, You might need to see if the same problem still persists and can be fixed to avoid this happening in future.
For sure the clean up is needed. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Cleaned and locked. |
|
Back to top |
|
|
rvcr3303
New User
Joined: 21 May 2022 Posts: 1 Location: Portugal
|
|
|
|
Want to be able to dowload program sample |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Please don’t tailgate the old posts .. if you have a question start a new topic.
Btw, if you read my earlier response then after your first post now you can able to download it. |
|
Back to top |
|
|
|