I have a program (LOC is 3500) when i stow I recieve a error saying that buffer overflow. So I need to split the program into two. Is there any simple way to perform?
There is no single answer to such a question. It would help to know, however, whether there are any logical subsets of code that can easily be isolated (e.g. as subprograms), or whether the entire program can logically be divided into two (or three) programs, each of which performs a limited set of functions, then “passes” data to the next program.
Also, what buffer is overflowing (3500 lines of code, while large, is not extreme)? Is it code or data? Can either be reduced? etc.
I was forced to do that once but in my case it was easy. The batch program was generating multiple reports from an extract file. I duplicated the program and, keeping the work areas exactly the same in both, kept the code for some reports in one and the code for the rest in the other. I kept any subroutines needed in both - like code expansions.
I have seen cases for online programs where the method was to move any large function (clear inputs and outputs) in the program to a new subprogram.