|
On 8/9/06, rob@xxxxxxxxx <rob@xxxxxxxxx> wrote:
Another rule I follow that simplifies things and eliminates the need for conditional compilation is "PR include source members themselves dont include other PR source members".
If I have a common utility that is used by both the service program, and the main program, I may not have the prototype in the PR for the main program but I may have it in the main program member itself. I suppose, if I've just added the use of the service program and now when I compile it I start getting duplicate definitions on the PR I could delete it from the main program. The problem with that is it leaves a bad taste in the mouth of other developers and they'll rewrite the service program to get their own function or not use the PR member for the service program, but instead copy/paste what they need from the PR member for the service program directly. Again, the boss says I am not allowed to kneecap anyone.
where is the PI code for the common utility? If the PI code is anywhere but in a module that has been bound into a srvpgm, then start kneecapping. Maybe people are getting in trouble with includes because they are including both the PI and PR code of the common procedure? You have a common procedure named core_CrackPath. It takes an IFS path and cracks it into its directory path, file name and file extension parts. That procedure belongs in the COREPROCS srvpgm and its prototype is found in the PRCORE srcmbr. Whenever a module contains code that calls the core_CrackPath proc, that module has to include the PRCORE srcmbr.
When the PR srcmbr of an application srvpgm references a data element that is defined in another PR srcmbr ( like( custref.custnbr )), then the module that included the application PR srcmbr also has to include that 2nd PR srcmbr. This nesting gets rather intense.
not really. You end up putting a lot of prototypes in the PRCORE srcmbr but the compiler seems to blast right thru such includes even on the typical geared down 520. I have a PRAPI srcmbr for system api prototypes. then there is PRCORE for common procs that handle string primitives like parsing a comma delimeted string. If you build XML procedures you would have an XMLPROCS srvpgm and PRXML srcmbr. -Steve
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.