What are the commands to split an RPG program so more lines can be added? Also, how to merge the 2 sources together again? My current source has 32,000 lines.
Best thing to do is rewrite it to cut maybe 31,500 or more lines out. Break areas into functional procedures, compile them into *MODULEs and bind them into a complete *PGM object.
One potential beginning step is simply to copy sections of code into separate source members. The sections should each contain source lines that are logically connected, for example complete subroutines.
Replace the copied sections with /COPY statements in the original source member.
You might even create subroutines to cut into new source members if needed.
Of course, there's no real reason to do anything since you can have much more than 32000 source lines in a source member. For a test, I just edited a RPGLE source member that had 190464 source lines, including inserting a new line to bring it to 190465 lines. No problem.
I agree with Raven. Program that get that large are hard to maintain. We have a lot of very large programs, We have either broke out sections into external calls or copybooks to keep code size down. This is a good way to maintain pieces of code that are normally duplicated in many programs. You just change one copybook, call or stored procedure then recompile all that use it and you are good to go.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 2  Replies
One potential beginning step is simply to copy sections of code into separate source members. The sections should each contain source lines that are logically connected, for example complete subroutines.
Replace the copied sections with /COPY statements in the original source member.
You might even create subroutines to cut into new source members if needed.
Of course, there's no real reason to do anything since you can have much more than 32000 source lines in a source member. For a test, I just edited a RPGLE source member that had 190464 source lines, including inserting a new line to bring it to 190465 lines. No problem.