Check out the command CVTRPGSRC
Simplest way is to run the source through the CVTRPGSRC ‘Convert RPG Source’ command. Compile the resulting RPG IV source into a test environment before deciding to go forward with it. Since some elements of RPG III don’t translate cleanly to RPG IV, you should review the new source to decide if you want to put much cleanup effort into the source to take advantage of new builtin functions or op-codes or data definitions.
Compile first as straight DFTACTGRP(*YES) to maintain RPG III run-time compatibility.
That’s the absolute minimum description of converting RPG III to RPG IV. It’s possible that much of what you do will be no more than that, but there will also be spots where you need to know more.
Before attempting any real conversion, read the Using the RPG III to RPG IV Conversion Aid topic in the Information Center. Read through all of the pages by clicking the ‘Next page’ links at the bottom of each page.
Single programs can convert pretty easily. But whole applications can require knowing how all of the pieces fit together. At some point, there will be relationships like overrides where one program affects how another program runs. If you don’t pay attention to the relationships, things can get confusing when they work just a little differently.