Skip to content

5250 screens and web interfaces: paths to modernizing the UI

B2Bnetwork team · · 6 min

IBM i, RPG and mainframe

In brief

You can modernize a 5250 interface on IBM i in four ways: a better emulator, a refacing layer that turns screens into web pages (for example IBM HATS), RPG Open Access, which routes display file operations to your own handler program, or a new web application over APIs. The first two paths are fast but do not change the process. The last one requires separating logic from screen programs. The choice depends on who uses the screen: an operator entering data, or a customer and partner.

How a 5250 screen works

A 5250 screen is a display file (DSPF) described in DDS: record formats with fields at fixed positions, function keys and indicators. An RPG program shows a format with the EXFMT operation, waits for Enter or a function key and reads the fields that were typed. Lists are handled with subfiles, which are scrollable tables of records. The emulator connects to the system over Telnet and draws the screen character by character.

In such a program, logic and interface are intertwined. The same program checks whether a customer exists, calculates a discount, sets an error indicator and displays a message. That is the main obstacle in any modernization: you cannot change the look without touching the program or without a layer that pretends to be the user.

Before deciding, it is also fair to say what a 5250 screen does well. An experienced operator enters an order using only the keyboard, without a mouse, in a few seconds, and the screen responds instantly. A web interface that requires clicking into five fields can slow down a customer service team, even if it looks better in screenshots.

Four paths and their cost

PathWhat changesAdvantagesLimitations
Newer emulatorOnly the program the screen runs inNo changes to the applicationLook and process unchanged
Screen refacingScreens turned into web pages on the flyQuick result, programs unchangedScreens still drive the process, a screen change needs a refacing fix
RPG Open AccessDisplay file operations go to a handler programPrograms stay, the browser draws the interfaceLogic still tied to the screen flow
New application over APIsLogic in procedures, interface separateFull freedom in the interface, the same logic for many channelsThe most work, requires separating logic

The simplest step is replacing an old emulator with IBM i Access Client Solutions, the IBM client that includes a 5250 emulator. It tidies up workstations, but users see the same screens.

The paths are not mutually exclusive. A common setup is an emulator for operators, refacing for rarely used functions and a new application for customers and partners.

Screen refacing

A refacing layer reads the 5250 data stream and builds a web page from it. The program on IBM i does not know there is a browser on the other side. According to IBM documentation, IBM HATS (Host Access Transformation Services) creates web and rich client applications with a graphical interface for 5250 applications on IBM i and 3270 applications on the mainframe, as well as web services that expose the logic contained in those applications.

This path makes sense when you need to give browser access quickly, for example to branches or partners, and the application will not change much. Its weakness shows in the process: if an order requires going through six screens, the user still goes through six pages. A web service built on refacing also clicks through screens, so it is slower and more fragile than calling a procedure.

RPG Open Access

Open Access is an RPG mechanism in which a file declared in the program with the HANDLER keyword does not go to a device but to a handler program. IBM documentation describes three parts: an RPG program with ordinary file operations, a handler called by Open Access, and the resource the handler communicates with. IBM does not provide the handlers: they are written by tool vendors, business partners or users themselves.

For the interface, this means a program with EXFMT can send the format's data to a handler, which passes it to the browser as JSON, and the browser draws its own form. The program changes minimally, usually by the HANDLER keyword in the file declaration. The interface gets a modern look faster than with a rewrite, but the screen formats still dictate the flow.

A new application over APIs

The lasting path starts with logic, not with the look. The steps are:

  1. Extract the logic from the screen program into procedures in a service program: validation, calculations, writes.
  2. Switch the old screen to those procedures, so both paths use one piece of code.
  3. Expose the procedures as REST services, as we describe in the article IBM i and modern applications: integration through REST APIs.
  4. Build the new interface on top of the services, one process at a time, and keep the old screen for those who need it.

The new interface does not have to repeat the screens. A process that took six steps on 5250 can be a single form with suggestions in a web application. We cover this strategy in more detail in the article IBM i modernization: refactoring, APIs or migration.

A customer-facing interface must also be accessible to people with disabilities. In services covered by the European Accessibility Act, this is a legal requirement, described in the article The European Accessibility Act, and how to check it is covered in the article WCAG accessibility testing.

How to choose and where to start

Splitting users into groups makes the decision easier:

  • operators who work in the system all day usually gain the least from a new look and lose the most from slower data entry;
  • occasional users (managers, field sales) need a browser and a phone, not keyboard shortcuts;
  • customers and partners should not see a 5250 screen in any form.

A good start is one process with a clear goal, for example a salesperson checking order status on a phone. Measure the task time and the number of errors before and after the change, and try the new interface with a few real users. The section What we do describes the scope of our work on IBM i systems.

Questions and answers

Is a 5250 emulator in the browser already modernization?

It is a change of access, not modernization of the application. Users do not need to install anything, but they see the same screen, the same keys and the same process. This step can be useful, for example for remote work, but it does not solve the problem of new employees who find the green screen hard to learn, nor does it open the system to customers.

Can we keep 5250 screens for some users?

Yes, and it is often the best solution. If the logic is extracted into procedures used by both the old screen and the new application, both paths calculate the same way. Operators keep fast keyboard entry, and everyone else gets a browser. A screen is retired only when nobody uses it anymore.

What about testing after the interface changes?

The most important thing is to check that the new path calculates the same as the old one. Tests of REST services and comparing data after operations performed through both interfaces give you confidence faster than manual clicking. Automated tests of 5250 screens are possible but fragile, as we explain in the article Automated tests for IBM i applications.

How does screen refacing differ from RPG Open Access?

Refacing works outside the program: it reads the 5250 data stream and turns it into a page, so the program stays unchanged. Open Access works inside the program: the HANDLER keyword routes file operations to a handler that sends the data to the browser. Open Access gives more control over the data, but requires recompiling the programs.

What it looks like in a project

Developing a system on IBM i or mainframe? Talk to an RPG engineer.

Let's talk

Read more: IBM i, RPG and mainframe