Est. 1988 Intermediate

RPG/400

IBM's RPG III dialect rebranded and integrated for the AS/400, the procedural business language that ran a generation of midrange enterprise applications on OS/400.

Created by IBM

Paradigm Procedural, Imperative
Typing Static, Strong
First Appeared 1988
Latest Version Maintained on IBM i for legacy support; superseded by RPG IV (ILE RPG) in 1994

RPG/400 is the name IBM gave to its RPG III compiler when it launched the AS/400 in 1988. It is not a wholly new language but a rebranding and platform integration: at its introduction, RPG/400 was essentially the same RPG III language that had run on the System/38, now packaged with the new AS/400 hardware, its OS/400 operating system, and the system’s integrated relational database. For roughly a decade it served as the primary procedural business language of one of the most successful midrange computing platforms ever built.

History & Origins

RPG’s roots reach back to 1959, when IBM released the original Report Program Generator for the IBM 1401 as a tool for producing business reports. Its design was shaped by the punched-card and unit-record equipment of the era: each statement’s meaning depended on the columns its characters occupied. That fixed-format heritage carried forward through RPG II (introduced with the System/3 around 1969) and RPG III (introduced with the System/38 in 1979), which added structured operation codes, subroutines, and externally described files.

When IBM announced the AS/400 on June 21, 1988, it set out to replace and unify the earlier System/36 and System/38 product lines with a single new midrange platform. As part of that effort, IBM rebranded almost all System/38 software with the /400 suffix, and the RPG III compiler was no exception: it became RPG/400. At the moment of its introduction the language was, by IBM’s own characterization, essentially identical to the RPG III compiler that had shipped on the System/38 - the changes were primarily about packaging, naming, and integration with the new OS/400 environment rather than the language itself. Over the following years the dialect picked up incremental enhancements as the platform matured.

The next major step came in 1994, when IBM introduced RPG IV (also called ILE RPG) with OS/400 V3R1. RPG IV brought the language into the Integrated Language Environment (ILE), added the longer Extended Factor-2 calculation specification, and modernized data definitions. From that point onward RPG/400 became the older, fixed-format dialect, while new development gradually shifted to RPG IV.

Design Philosophy

RPG/400 inherited the core philosophy of the RPG family, refined for the AS/400:

  • The program cycle. Like its predecessors, RPG/400 was built around the RPG logic cycle - an implicit, built-in loop that read input records, performed calculations, and produced output. Programmers could write substantial report and update programs by filling in specifications and letting the cycle drive execution, though explicit control flow was also fully supported.
  • Fixed-format specifications. Source code was organized into typed specification lines occupying prescribed column ranges: Header (H), File (F), Input (I), Calculation (C), and Output (O) specs, plus extension and line-counter specs. Each character’s position carried meaning, a direct legacy of the punched card.
  • Database as a first-class citizen. RPG/400 was designed around the AS/400’s integrated database. Files could be externally described - their field layouts defined once at the database level and shared by every program - so applications and data stayed tightly and consistently coupled.
  • Business data orientation. Strong, static, packed-decimal arithmetic and fixed-length field definitions made the language well suited to the exact, money-handling computations that business applications demand.

Key Features

  • Specification-based source. Programs were written as columns of H-, F-, I-, C-, and O-specifications, each governing a distinct aspect of the program (control options, files, input layouts, calculations, and output).
  • Externally described files. By referencing database file definitions directly, programs avoided redundant field declarations and stayed synchronized with the integrated database.
  • The RPG cycle. The implicit input/calculation/output cycle handled primary-file reading and report production with minimal explicit code, while operation codes such as READ, CHAIN, SETLL, and DOW gave programmers direct control when needed.
  • Structured operation codes. Inherited from RPG III, structured opcodes such as IF/ELSE/ENDIF, DO, DOW, DOU, and SELEC/WHxx allowed clearer logic than the conditioning-indicator style of older RPG.
  • Indicators. A characteristic set of numbered logic indicators (*IN01-*IN99, plus special indicators like *INLR) controlled conditioning of calculations and output and signaled conditions such as last-record processing.
  • Tight OS/400 integration. RPG/400 worked hand-in-hand with the AS/400 environment, calling system programs and interacting with the database, display files, and printer files that defined classic green-screen business applications.

Evolution

RPG/400 occupies a transitional place in the RPG lineage. It began life in 1988 as RPG III under a new name, accumulated incremental improvements through the early AS/400 years, and was then progressively displaced after RPG IV arrived in 1994. RPG IV’s free-form calculation specifications (added in 2001) and later fully free-form syntax modernized the developer experience far beyond what RPG/400 offered, and IBM steered new development toward the ILE-based compiler. Even so, the RPG/400 compiler was never abandoned: when the platform was rebranded IBM i (continuing the AS/400 / iSeries / System i lineage), the RPG/400 compiler remained available so that the enormous body of existing fixed-format source could still be compiled and maintained.

Current Relevance

RPG/400 is no longer the language of choice for new projects - that role belongs to free-form RPG IV - but it remains highly relevant as legacy code. Many organizations still run business-critical applications whose origins trace to RPG/400, and maintaining, recompiling, and modernizing that code is an ongoing reality on the IBM i platform. RPG/400 source is frequently the starting point for modernization efforts, whether that means converting fixed-format calculations to free-form, refactoring monolithic cycle-driven programs into modular procedures, or wrapping existing logic behind web services and APIs. Understanding RPG/400 is therefore essential for anyone working with the substantial installed base of long-lived AS/400-era systems.

Why It Matters

RPG/400 represents the moment RPG became the defining language of the AS/400, one of the most commercially successful business computing platforms in history. By carrying RPG III forward under a new name and binding it tightly to OS/400 and its integrated database, IBM gave a generation of enterprises a productive, reliable tool for building the order-entry, inventory, and accounting systems that ran their operations. The decisions baked into RPG/400 - the program cycle, fixed-format specifications, externally described files, and indicator-driven logic - shaped how a huge community of business programmers thought about software, and the code they wrote still underpins real operations decades later. As the immediate predecessor of RPG IV, RPG/400 is a key link between RPG’s punched-card past and its modern, free-form present.

Timeline

1959
IBM introduces the original RPG (Report Program Generator), a column-oriented, fixed-format language for producing business reports, the ancestor of all later RPG dialects.
1969
RPG II appears with the IBM System/3, broadening RPG from a report tool into a general business programming language for IBM's small-business systems.
1979
RPG III arrives with the System/38, adding structured operations, externally described files, and tighter database integration - the dialect that RPG/400 would later be based on.
1988
IBM announces the AS/400 on June 21, 1988, consolidating the System/36 and System/38 lines. The RPG III compiler is rebranded RPG/400 and integrated with OS/400 and its built-in database.
1994
RPG IV (ILE RPG) is introduced with OS/400 V3R1, modernizing the language under the Integrated Language Environment and beginning the transition away from RPG/400.
2008
The AS/400 lineage is rebranded IBM i; the RPG/400 compiler remains available for compiling and maintaining legacy fixed-format source on the platform.

Notable Uses & Legacy

AS/400 enterprise business systems

RPG/400 was the workhorse for core line-of-business applications on the AS/400 - order entry, inventory, billing, payroll, and general ledger systems - across manufacturing, distribution, banking, and insurance.

Packaged ERP and industry software

Independent software vendors built and shipped ERP and vertical-market packages written in RPG/400, many of which were sold and installed widely across the large AS/400 customer base of the late 1980s and 1990s.

Db2 / OS/400 database applications

RPG/400 programs used native, record-level I/O against the AS/400's integrated relational database, making it the standard language for data-driven business processing tightly coupled to OS/400 files.

Legacy systems still in service

Large volumes of RPG/400 source remain in production on IBM i today, where it is maintained, recompiled, and incrementally modernized - often as the starting point for migration to RPG IV free-form.

Language Influence

Influenced By

RPG III RPG II

Influenced

RPG IV

Running Today

Run examples using the official Docker image:

docker pull none

Example usage:

# RPG/400 requires an AS/400 (IBM i) system - no Docker image available
Last updated: