There is no single right answer for modernizing RPG (IBM i / AS/400). Here is what the realistic paths actually look like, and what matters most when choosing between them.
RPG's program cycle, the implicit read-and-loop behavior inherited from punched-card tabulators, is the single biggest source of surprises in a rewrite. Code that looks simple in RPG can hide behavior that a direct line-by-line translation into Java or C# will silently get wrong. Shops that modernize successfully tend to either wrap existing RPG behind APIs (OpenLegacy's approach) rather than rewrite it, or budget real time for a domain expert to validate the converted logic against the original's actual runtime behavior, not just its source code.
Keep the code, modernize around it
Vendors taking this approach for RPG (IBM i / AS/400): Rocket Software, ARCAD Software, OpenLegacy.
Rewrite or convert to a new platform
Vendors taking this approach for RPG (IBM i / AS/400): AWS Mainframe Modernization (Blu Age), Accenture.
Keep it running, don't change it yet
Vendors taking this approach for RPG (IBM i / AS/400): IBM.
Fill the workforce gap without a migration project
Vendors taking this approach for RPG (IBM i / AS/400): TCS / Infosys.