|
> So why reinvent the wheel or rewrite a good > working, existing programme and tranform it > to a procedure? Perhaps the only adjusment > required is prototyping the call. Carel, you said it better than I did. I think the dispute is over what 'good' means. In my case, at an earlier job I had an application that was made of small server programs. In order for it to run fast enough, we had to use shared ODP's and return without LR. I would NOT advise changing that application to use procedures today because it DOES work well and it DOES run fast. > I worked in a software shop, where the reply to > a request for newer coding tecniques was: "Our > clients are not interested how the programmes > are coded, only that those programmes work > as intended and without errors." We certainly have that attitude. Which is while RPG IV and ILE have been helpful here. >I think a lot of (software) shops have that attitude, >as ILE requires a (complete) redesign of application >development and the existing code (the legacy) >is not that easily transformed. I think you are partly correct. A full ILE application with shared resources (multiple activation groups) requires careful design. But it is not a difficult chore to add a sub-procedure to an existing program (even using a service program to hold it.) Let me share an example of how this has personally helped me. I had a large, old-fashioned LARGE program that was converted to RPG IV (to use the larger arrays!), but did not use sub-procedures. I had to add a section of code to verify whether a telephone number was in the local calling area or not. I already had a subroutine in another program that did almost the same thing, but the field names were all wrong. I had two choices: make the subroutine into a program and call it, or make it into a sub-procedure. By making it a sub-procedure, I was able to make this change to the main program. >From this: If test1 and test2 and test3 to this: if test1 and test2 and test3 and localCall(telephoneNumber) Or, I could have made a temporary variable and done this: call localcall parm telephoneNumber parm isLocal if test1 and test2 and test3 and isLocal Either way works, but the sub-procedure is a little more flexible, because I don't need another variable. The point is that I was very comfortable making this change to the large program, because I _knew_ that the change I made would not have any repercussions beyond the one test. This means I can make changes faster than having to analyse all possible name collisions, and that my changes are more reliable. So that is why I use sub-procedures in RPG IV even though I am not doing full ILE. Groetjes! :-) --buck
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.