Error in compilation of RPG Program

anuar8080 used Ask the Experts™

I am trying to compile this RPG program but it keeps hitting error as below and it say that it cannot be complied because the binding directory . TQ


Error as below from job log as below

    Comments  . . . . . . . . . . . :     2134                        
         * * * * *   E N D   O F   F I N A L   S U M M A R Y   * * * *
                 B i n d   D i a g n o s t i c   M e s s a g e s      
Errors were found during the binding step. See the job log for more inf
 * * * * *   E N D   O F   B I N D   D I A G N O S T I C   M E S S A G
Program FILE in library MYLIB not created.          
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Theo KouwenhovenApplication Consultant

Please try to compile this program interactively with:

If not succesfull, please post your compiler-listing here.

VP Technology / Senior Consultant
Please post the job log from the failed compile.  

Creating a bound RPG involves two steps.  First, the current module gets compiled.  Second, and references to other modules (including modules bound into service programs) get resolved.  The binding error indicates that the module probably compiled successfully, but binding failed.  You probably need to specify a binding directory in your program H specs or in the CRTBNDRPG command so that the linker can find external procedures that you referenced in the program.

You can check this by using the CRTRPGMOD command (interactive or batch) to create a module (CRTBNDRPG does this under the covers), and check to see if module creation is successful - you'd get a MODULE object.

Then use the CRTPGM command interactively to bind your module with any other required modules or service programs.  If it fails just display your job log (DSPJOBLOG) and look at the detailed error messages - odds are it will tell you exactly what the problem is.  Then you just need to figure out where the missing reference is located, and reference the correct binding directory, service program, or module when you create your program.

-Gary Patterson
Gary's right. The compile listing indicates that the error should be found in the joblog wherever the compile was run. Without the error from the joblog, there's no way to know what the problem is.

Technically, it might also be possible to guess the problem from seeing the entire source listing. For example, you might have a call to a procedure that could be found in the QC2LE binding directory and that's not shown on your CRTBNDRPG command. Similar possibilities might also be visible.

But the joblog should give a specific message.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial