|
Hello all, I am facing a difficult situation. I will try to make it as clear as possible. We are using conditional compilation instructions in our program to incorporate prototype while maintening only one source. Ex: In SRVPGMA /if not defined(copying_prototypes) h nomain /endif Here we have all the exported prototypes /if not defined(copying_prototypes) Here is the code for all the procedure of the service program /endif In PGMB that want to use SRVPGMA H spec D spec /define copying_prototypes /copy qrpgsrc,SRVPGMA /undefine copying_prototypes the rest of the code This way, the prototypes instructions are located in the same source as the corresponding procedure. This works great with RPGLE program type. Here is where it gets complicated. We are starting to use SQL. So the source type is SQLRPGLE and we create our program by first using CRTSQLRPGI to create a module and then CRTPGM to bind it with the service program. This does not works. It looks like the precompiler treats SQL differently (it add one more step). It create a source in qtemp in which all the /copy are resolved. Then it add some more code for the SQL parts. But some of the SQL D spec get included between the /if and /endif so they are ignore and the compilation fails with 7030 error. The intermediate source looks like this: H spec D spec /define copying_prototypes ** this comes from SRVPGMA /if not defined(copying_prototypes) h nomain /endif Here we have all the exported prototypes /if not defined(copying_prototypes) **** Here, the SQL D spec gets inserted <İİİİİİİİİİİÑere is the code for all the procedure of the service program /endif /undefine copying_prototypes the rest of the code Because of where the SQL D spec gets inserted, they are ignore during compilation. Any Idea? Denis Robitaille Directeur services techniques Cascades Inc 819 363 5187 fax 819 363 5177
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.