I have a module which has a copy book in it and when I am creating a main PGM with the command CRTPGM by giving the module name itself as the PGM name and binding the service programs, I am getting an error which says that the procedures which are defined in the copy book are not defined. How to resolve the error? Do I need to add the copybook anywhere? If so could you please let me know where I need to add it?
Software/Hardware used:
iseries/as400
ASKED:
February 25, 2013 7:04 AM
UPDATED:
February 25, 2013 12:54 PM
If you’re using CRTPGM and procedures are copied via a COPY statement, the COPY statement should be irrelevant. The module would have to be previously compiled with CRTRPGMOD, the copied procedures would already be included.
The alternative would be that the COPY is only copying procedure prototypes and not copying the procedures at all. That’s a much more likely case. The procedures are most likely in a different module. Assuming that the module (or modules) is also already compiled, then it must be listed as a second (or third or more) module in the MODULE() parameter list.
If not listed explicitly, additional modules might be included through inclusion of the service program that contains the procedures in the BNDSRVPGM() parameter; they might be defined with binder language and referenced through the BNDDIR() parameter.
If this additional module (or modules) is included in more than one program, then it should be part of a service program.
In general, entire procedures shouldn’t be included with COPY statements. So some additional module is probable.
Tom