In brief
IBM i modernization is chosen by what actually gets in the way. When the problem is unreadable code, in-place refactoring is enough: free-form RPG, procedures, SQL instead of DDS. When integrations and a new interface are missing, you build an API layer over the existing logic. Migrating off the platform makes sense only when the company is changing its processes or system anyway and the business rules stored in the code are known and documented.
Diagnosis first, then the path
Most failed modernizations start with choosing a technology rather than asking what does not work. Before a decision is made, it is worth answering five questions:
- What gets in the way of the business: the time it takes to make changes, missing integrations, the 5250 interface, cost, staffing risk?
- How many programs, files, and batch jobs are there, and which of them are actually used?
- Are the business rules described anywhere, or only in the code?
- Are there tests that will show the system calculates the same after a change?
- Who knows the system, and for how much longer will they be available?
The answers usually point to one of three paths or a combination of them. We describe how to take stock of a system in the article Documenting a legacy system when its authors are gone.
Path 1: in-place refactoring
Refactoring leaves the application on IBM i but changes how it is built. A typical scope:
- moving from column-based RPG to free-form in programs that are being changed anyway,
- extracting logic into procedures in service programs,
- describing the database in SQL instead of DDS, with keys, constraints, and long names,
- moving sources to git, code review, and automated compilation,
- tests for the most important procedures and batch processes.
This is the lowest-risk path, because each change can be deployed separately while the system keeps running. Its weakness: it does not by itself solve the lack of integrations or an interface that puts off new employees. We describe the language details in the article RPG today: free-form and modern tools.
An example of the order from a manufacturing company: first git and compiling from sources, then tests for the pricing module, and only then rewriting the pricing as procedures in a service program. Each step is a separate deployment and each can be rolled back. After a year, the module everyone was afraid of has tests, readable code, and two people who know it.
Path 2: an API layer over the existing logic
The second path leaves the logic in RPG but opens it to other systems. Procedures and programs are exposed as REST services, for example through IWS (Integrated Web Services), and a new web or mobile interface uses these services. The logic for discounts, reservations, or settlements stays in one place.
An example from a wholesaler: the salespeople's app checks product availability and price through an API, and the order goes to the same procedure that a 5250 screen used to call. The salespeople get a new tool, and the IT department does not maintain two copies of the pricing rules.
An API layer also lets you move functions gradually: a new service can be built in another language and another place, and the old one stays until the new one takes over all the traffic. This is the strangler fig pattern, described in more detail in the article Core banking modernization: migration strategies and their risks. We show the integration technique in the article IBM i and modern applications: integration through REST APIs.
With this path you need to watch two things. The first is security: a REST service opens the system to new clients, so it needs authentication, TLS encryption, and a user profile with the least privileges necessary. The second is performance: a procedure written long ago for a single screen may not withstand hundreds of calls per minute from a mobile app, so it is worth measuring it before exposing it.
Path 3: migration off the platform
Migration means moving the application to another platform: rewriting it, automatically converting the code, or replacing it with an off-the-shelf system, for example a new ERP.
| Variant | What happens | Main risk |
|---|---|---|
| Rewrite | New code in another language based on reconstructed rules | Missed rules that only the old code knew |
| Automatic conversion | A tool translates RPG into another language | Code that is hard to maintain, logic unchanged |
| Off-the-shelf system | Deploying a package and adapting processes | A change in how the whole company works |
In all variants, the most expensive part is reconstructing the business rules, not moving the data. A program that has been calculating discounts for twenty customer groups for fifteen years contains exceptions nobody remembers anymore. Without tests that compare the results of the old and new systems on the same data, a migration is a gamble.
Migration makes sense when the company is changing its processes anyway, when the system is small and well documented, or when the platform stops meeting requirements that cannot be worked around. The argument “old technology” alone is usually not enough.
How to combine the paths in practice
In most companies, the best plan combines all three elements in order from the lowest risk.
- Order. Git, an inventory of objects, removing unused programs, regression tests for the main processes.
- Database in SQL. The move from DDS to DDL, which opens the data for reports and integrations. Described in the article Db2 for i: SQL instead of DDS and a migration plan.
- APIs. Services for systems that today wait for exchange files or manual retyping of data.
- A decision on the rest. After the first two steps, the company knows what it has in the system and can fairly compare further modernization with migration.
Each step delivers value on its own, so the project does not hang on one big deployment. For data migration and a change of the system core, comparison tests are decisive; an example of the approach is shown in the scenario data migration tests when merging two banks.
Questions and answers
How long does modernizing an IBM i application take?
It depends on the size of the system and the chosen path. Refactoring and an API layer go in small steps, so the first results, such as a first REST service or code in git, are visible after a few weeks, and the whole thing spreads over months or years. Migration off the platform is usually a multi-year program, because it requires reconstructing rules and comparison tests.
Can the 5250 interface be modernized without rewriting programs?
It can, though with limits. Tools that put a web interface over 5250 screens give a quick visual effect, but the process and logic stay the same. A more lasting path is to extract the logic into procedures, expose it through APIs, and build a new interface over the services. Then the same code serves both the old screen and the new application.
When does migrating off IBM i not make sense?
When the only reason is the age of the platform, and the system runs stably and meets requirements. Migration also makes no sense when nobody knows the rules stored in the code and there are no tests to compare results. Then the first step is documentation and tests, and the decision on migration is made only once it is clear what has to be moved.
How do you check that the system calculates the same after modernization?
Most reliably through comparison tests on the same data: the same set of orders, invoices, or settlements goes through the old and the new code, and the results are compared automatically, for example with an SQL query. The differences have to be explained with the business, because some of them are errors in the old system that users know about and work around.
Sources