I am compiling a COBOL85 Program and I am getting Error
**** BINDER ERROR 17 **** Code space overflow in proc:
I have used COMPACT & LESS-CODE 1 compiler directive in the program.
Still I am getting the above error
If that's so, then the best solution is to break up your code into 2
or more modules, compile them separately, and bind them.
Does this help you?
The program exceeded the maximum amount of code space available. Use
the
COMPACT directive to instruct Binder to compact the object file by
rearranging code
blocks. Alternatively, you can use the SET USERLIBRARY ON command to
change
the number of code segments allowed from 16 to 32.
Yah I too think so. Due to age of the program, probably it has become
really large. If it is not very difficult, why don't you convert the
program to native and get rid of these issues?
Given the directives you have tried already, I imagine you understand that the problem is that the object file you are building with that compilation has run out of code segments to use for the programs begin compiled. As I understand it, this is a different error than the one that means one of the individual programs is too large to fit in a single code segment.
Although you don't say this, I imagine the program you are compiling is not one large procedure division, but either many separately-compiled COBOL programs stacked into one large source file, or you have many separately-compiled programs each compiled with separate runs of the compiler, and the compilation getting the error is the one compiling the main program, which references the other programs using ?SEARCH. In those cases, I think it is fairly easy to fix the problem.
If the program is one large file containing many nested COBOL programs, I don't know whether it is possible to fix the problem easily.
If you have one of the first two cases, I think what will work is to rearrange your programs so that you compile them each in separate runs of the compiler, and do not use ?SEARCH. Then use BIND to combine all of the object files into the final runnable object file and be sure to use the BIND command:
SET USERLIBRARY ON
What that command does is tell BIND that it can use all 32 code segments for the object code. Without that command, BIND reserves half of the code segments for a user library file. Of course, if your program already relies on using a user library at run time, then you cannot do this.
If this explanation is enough for you figure out how to solve the problem, that's great. If it is still not clear what you should do, or you try something and it does not work, post again and tell us more details about how your program is structured, how you compile it, etc., and we'll try to tell you more about how to try to solve the problem.
In the above, I assumed that your program consists of nothing but COBOL. If your program calls programs written in TAL or other languages and you use ?SEARCH to tell the compiler about the details of the calling sequence for those non-COBOL programs, you might need to replace the ?SEARCH commands with ?CONSULT commands for those programs. You could try leaving the ?SEARCH commands for just the non-COBOL programs; that might work.