Some points of attention.
As we have already mentioned, RPG and Java are two very different realities. Managing those differences that should be points of attention is a success factor.
We can quickly point out some of these topics.
The RPG is practically embedded within the AS/400 platform. This strong dependency on the RPG code and the operating systems is the first hurdle to overcome.
The intensive use of OS included within RPG programs is perhaps the biggest problem. For example, alternatives to features such as Open Query File (OPNQRYF), Work Submitted Job (WRKSBMJOB), or Work Spool Files (WRKSPLF), which RPG programmers permanently use, must be sought.
RPG queries based on PF (physical file) and LF (logical file) file systems are high-speed, so optimizing SQL queries on the target platform is also crucial. An AS/400 programmed in RPG is a speedy platform running business applications that include many disk access. The resulting system must maintain or improve these features. It is not always easy.
The RPG is a language designed as unstructured, but we must translate it into Java, a modern, strongly structured language. So, for example, a list of flow instructions, which will probably include a significant number of GOTOs, will need to be converted to structured code.
Some of the instructions in RPG code deviate from the paradigm of open systems and Java. For example, screens and programs are tightly coupled, making it difficult to evolve to a multi-tier architecture.
Or the handling of information at bit level with instructions such as BITON and BITOF.
Although the first answer to data migration is converting the AS/400 files to tables in an RDB and transforming the EBCDIC to UTF-8, in some cases, due to linking with external systems that also use EBCDIC, this solution can be problematic. There is no single formula; only a detailed system analysis can guide us.