On Friday I was asked if I could help with a compilation error for a RPGIII program. When the source was compiled it produced a CPF6301 message, see below, and the programmer could not understand what it meant or how to fix it.
Message . . . . : Program PGM1 in library LIB1 is not created as CPF6301 received. Cause . . . . . : Compile terminated in phase QRGRT at MI instruction number '00000'X with message CPF6301. Text for message is: ERROR IN COMPILER. COMPILE TERMINATED.
After a quick search I found that this has been happening in every release since V5R3. The problem occurs when additional code is added to very large RPG (RPGIII) source members, the compiler cannot create a new program as it out of available Object Definition Table entries.
IBM defines a Object Definition Table, ODT, as:
A table built at compile time by the system to keep track of objects declared in the program. The program objects in the table include variables, constants, labels, operand lists and exception descriptions. The table resides in the compiled program object.
Two solutions are offered:
- Split the RPGIII program into smaller programs.
- Convert source code to RPGLE (RPGIV), which is not affected by the ODT limit.
As no PTF is offered and the easier, best, solution is to convert the code to RPGLE, should reinforce to all of us that RPGIII is dead!
Unfortunately the person who brought this to my attention does not get it. He is breaking his monolith RPGIII source member into smaller ones, spending many hours to make his members small enough that this error will not occur. In my opinion the preferred solution is that he could spend just a few minutes to convert the source to RPGLE.
If you are not familiar with IBM's tool for converting RPGIII to RPGLE you should read RPGIII let it rest in peace. I am not saying you have to change all RPGIII source members to RPGLE now. Whenever you need to change a RPGIII program convert it to RPGLE and then make your change. Your future self will thank you for learning RPGLE, and not being a RPGIII Luddite.
You can learn more about the solution for this error from IBM's website here.