Est. 1979 Beginner

REXX

The scripting language that powered IBM mainframes - designed for human readability and still running enterprise systems worldwide.

Created by Mike Cowlishaw (IBM)

Paradigm Imperative, Procedural, Structured
Typing Dynamic, Strong
First Appeared 1979
Latest Version ANSI X3.274-1996

REXX (Restructured Extended Executor) is a scripting language designed by Mike Cowlishaw at IBM in 1979. Created with the explicit goal of being easy to read and write, REXX became one of the most successful scripting languages in computing history, particularly in the mainframe and enterprise computing world.

History & Origins

Mike Cowlishaw developed REXX at IBM’s UK laboratory in Hursley, England. Frustrated with the limitations of existing scripting tools on VM/CMS (specifically EXEC and EXEC 2), he designed a language that would be powerful enough for serious programming while remaining accessible to non-programmers.

The Design Philosophy

Cowlishaw articulated several key principles that shaped REXX:

  1. Human-oriented design - The language should be easy for humans to read and write
  2. Minimal special characters - Reduce the need for obscure symbols
  3. Free-form syntax - No rigid column requirements or complex formatting rules
  4. Powerful string handling - Strings are the fundamental data type
  5. Decimal arithmetic - Use human-friendly decimal math, not binary floating point

The Name

Originally called REX (Reformed EXecutor), the name gained a second ‘X’ in 1982 to become REXX, avoiding confusion with other IBM products. The “Restructured Extended Executor” backronym came later.

Why REXX Was Revolutionary

In an era of complex languages with rigid syntax, REXX stood out:

1. True Readability

1
2
3
4
5
/* Calculate the average of three numbers */
say "Enter three numbers:"
pull num1 num2 num3
average = (num1 + num2 + num3) / 3
say "The average is" average

No obscure symbols, no complex declarations—just readable code that does what it says.

2. Strings as the Universal Type

In REXX, everything is a string. Numbers, commands, variable names—all are strings that can be manipulated with powerful built-in functions:

1
2
3
4
name = "REXX Language"
say length(name)           /* 13 */
say substr(name, 1, 4)     /* REXX */
say reverse(name)          /* egaugnaL XXER */

3. Decimal Arithmetic

REXX uses arbitrary-precision decimal arithmetic, avoiding the floating-point surprises that plague other languages:

1
2
numeric digits 50
say 1/3          /* 0.33333333333333333333333333333333333333333333333333 */

4. Seamless System Integration

REXX can pass commands directly to the host operating system:

1
2
3
4
/* On a mainframe, this runs a system command */
"LISTCAT"
/* On a PC, this might be */
"DIR /W"

REXX Implementations

REXX runs on virtually every platform:

ImplementationPlatformNotes
IBM REXXz/OS, VM/CMS, OS/2The original, still in production
Regina REXXAll platformsMost popular open-source implementation
ooRexxAll platformsObject-oriented extension, open source
NetRexxJVMREXX-like language for Java platform
ARexxAmigaOSPioneered inter-application scripting
BrexxDOS, WindowsLightweight implementation
r4WindowsCommercial implementation

For this tutorial series, we’ll use Regina REXX, the most widely available open-source implementation that runs on modern systems.

The REXX Structure

REXX programs have a simple structure:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
/* Optional comment describing the program */
/* Comments are enclosed in slash-asterisk pairs */

/* Variables need no declaration */
greeting = "Hello"
name = "World"

/* Output with SAY */
say greeting || "," name || "!"

/* Loops */
do i = 1 to 5
    say "Count:" i
end

/* Conditionals */
if name = "World" then
    say "Global greeting!"
else
    say "Personal greeting!"

Key Language Features

  • Case insensitive - SAY, Say, and say are identical
  • Free format - No column restrictions (unlike older languages)
  • Comments - Use /* comment */ style
  • String concatenation - Use || or simple adjacency
  • No line continuation - Statements can span multiple lines naturally

The REXX Community

REXX maintains an active community:

  • Rexx Language Association (RexxLA) - Organizes annual symposiums and maintains standards
  • comp.lang.rexx - Usenet newsgroup active since the 1990s
  • Regina REXX Project - Ongoing development of the open-source interpreter
  • ooRexx Project - Object-oriented REXX development

REXX in Modern Context

While REXX’s heyday was the 1980s-90s, it remains relevant:

Still Running

  • Mainframes - Billions of lines of REXX scripts run enterprise systems daily
  • Legacy systems - Banking, insurance, and government systems depend on REXX automation
  • Network devices - Many enterprise networking tools still use REXX

Modern Use Cases

  • Mainframe DevOps - Modern z/OS development uses REXX for automation
  • Data processing - REXX’s string handling excels at text transformation
  • Teaching - REXX’s readability makes it useful for introducing programming concepts

Getting Started

REXX files typically use these extensions:

  • .rexx - Standard extension
  • .rex - Alternative short form
  • .cmd - OS/2 and Windows command files

A typical REXX development workflow:

1
2
3
4
5
6
7
# Write your program
cat > hello.rexx << 'EOF'
say "Hello, World!"
EOF

# Run with Regina REXX
rexx hello.rexx

Continue to the Hello World tutorial to write your first REXX program.

Timeline

1979
Mike Cowlishaw begins development at IBM UK, first implementation shared internally
1981
REXX publicly demonstrated at SHARE 56 conference in Houston
1982
Language gains its second 'X' to avoid confusion with other products
1983
First IBM product release as part of VM/SP Release 3
1985
'The REXX Language' book published; first non-IBM implementation released
1987
IBM announces REXX as SAA Procedures Language for all IBM platforms
1989
First REXX compiler developed at IBM Vienna; included in OS/2 1.2
1992
Regina REXX, the open-source implementation, first released
1996
ANSI Standard X3.274-1996 published, formalizing the language
2004
IBM releases Object REXX source code under open source license
2019
REXX celebrates 40th anniversary at the 30th Rexx Language Association Symposium

Notable Uses & Legacy

IBM Mainframe Scripting

REXX is the standard scripting language for VM/CMS, MVS/TSO, and z/OS, automating countless enterprise operations.

OS/2 System Scripting

IBM's OS/2 used REXX as its native scripting language, controlling everything from desktop automation to system administration.

AmigaOS ARexx

Amiga computers featured ARexx, enabling inter-application communication and automation years before AppleScript.

Network Device Configuration

Many enterprise network devices and telecom systems use REXX for configuration scripts and automation.

Financial Systems

Banks and financial institutions use REXX scripts to orchestrate mainframe batch processing and data transformation.

Healthcare Administration

Hospital systems running on mainframes frequently use REXX for report generation and data processing tasks.

Language Influence

Influenced By

PL/I EXEC EXEC 2 ALGOL

Influenced

NetRexx Object REXX Tcl Python

Running Today

Run examples using the official Docker image:

docker pull rzuckerm/rexx:3.6-5.00-1

Example usage:

docker run --rm -v $(pwd):/app -w /app rzuckerm/rexx:3.6-5.00-1 rexx /app/hello.rexx

Topics Covered

Last updated: