Est. 1970 Intermediate

CLIST

IBM's command procedure language for TSO on mainframes, enabling automation of interactive terminal sessions and integration with ISPF dialog services on z/OS systems.

Created by IBM

Paradigm Procedural
Typing Dynamic, Weak
First Appeared 1970
Latest Version z/OS 3.1 TSO/E (2023)

CLIST (Command List) is IBM’s command procedure language for TSO (Time Sharing Option) on mainframe operating systems. Introduced circa 1970–1971 as part of TSO in OS/360 Release 20, CLIST provides a way to automate sequences of TSO commands, interact with users through terminal I/O, and build interactive applications through integration with ISPF. While REXX has been the recommended scripting language for new TSO/E development since 1988, CLIST remains supported on z/OS and thousands of CLISTs continue to run in production at enterprises worldwide.

History & Origins

In the late 1960s, IBM was developing TSO as an interactive time-sharing facility for OS/360 MVT. TSO gave mainframe users direct terminal access to the system, replacing the purely batch-oriented workflow that had characterized earlier mainframe computing. When TSO shipped with OS/360 Release 20 in approximately 1970–1971, it included CLIST as its built-in command procedure language.

The original CLIST capability was straightforward: a CLIST was simply a sequential list of TSO commands stored as a member in a Partitioned Data Set (PDS). When executed, the TSO terminal monitor program (TMP) read and executed each command in order, much like a batch file on personal computers that would appear over a decade later. This basic form supported parameter substitution through symbolic variables but lacked control flow constructs.

The language gained significantly more power around 1975 when structured programming constructs were added in approximately OS/VS2 Release 3.6. This enhancement introduced IF-THEN-ELSE conditional logic, DO-WHILE and DO-UNTIL loops, and nested control structures, transforming CLIST from a simple command sequencer into a genuine procedural programming language.

TSO/E and the Arrival of REXX

In 1985, IBM released TSO Extensions (TSO/E), which consolidated and enhanced TSO capabilities. The more significant change came in 1988 when TSO/E Version 2 introduced REXX (Restructured Extended Executor) as an alternative command procedure language. REXX offered cleaner syntax, better string handling, reportedly faster execution (commonly cited as approximately 25% faster, though original benchmark conditions are not well-documented), and a more modern language design. IBM recommended REXX for all new development, though CLIST remained fully supported.

The two languages coexist in TSO/E to this day. The system distinguishes between them automatically: if the first line of a procedure contains a REXX comment (/* REXX */), it is executed by the REXX interpreter; otherwise, it is treated as a CLIST.

Design Philosophy

CLIST was designed as a practical automation tool rather than a general-purpose programming language. Its core principles reflect the mainframe environment it serves:

Command-oriented: CLIST’s fundamental unit of work is the TSO command. The language wraps command execution with variable substitution, control flow, and I/O capabilities, but it remains centered on invoking and orchestrating TSO commands.

Interactive by nature: Unlike JCL, which is batch-oriented, CLIST was designed for interactive terminal sessions. It can prompt users for input, display messages, and respond dynamically to user choices, making it the natural tool for building interactive workflows on TSO.

Integration over isolation: CLIST integrates deeply with the surrounding mainframe environment. It can invoke TSO commands, call programs written in COBOL, PL/I, or Assembler, access MVS datasets, interact with ISPF panels, and submit batch jobs. This integration capability is its primary strength.

Key Features

Variables and Data Handling

CLIST variables are prefixed with an ampersand (&) and are dynamically typed. The language provides built-in system variables that expose information about the session and environment:

1
2
3
4
5
PROC 0
SET &NAME = WORLD
WRITE HELLO, &NAME!
WRITE TODAY IS &SYSDATE, THE TIME IS &SYSTIME
WRITE YOUR USERID IS &SYSUID

Variables can hold character strings or numeric values. Arithmetic operations are supported for numeric values, and string concatenation uses simple adjacency or double ampersands.

Control Structures

After the structured programming enhancements, CLIST supports standard control flow:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
PROC 1 ACTION
IF &ACTION = LIST THEN +
  DO
    WRITE LISTING DATASETS...
    LISTDS
  END
ELSE IF &ACTION = STATUS THEN +
  WRITE SYSTEM STATUS: OK
ELSE +
  WRITE UNKNOWN ACTION: &ACTION

SET &COUNT = 1
DO WHILE &COUNT <= 5
  WRITE ITERATION &COUNT
  SET &COUNT = &COUNT + 1
END

The + character at the end of a line indicates continuation, and DO/END blocks group multiple statements.

Terminal I/O

CLIST provides direct interaction with the TSO terminal through WRITE (output) and READ (input) commands:

1
2
3
4
PROC 0
WRITE ENTER YOUR NAME:
READ &USERNAME
WRITE WELCOME, &USERNAME

ISPF Integration

One of CLIST’s most important capabilities is its integration with ISPF dialog services. CLISTs can display ISPF panels, process user input from those panels, build table-driven applications, and manage ISPF variables:

1
2
3
4
PROC 0
ISPEXEC DISPLAY PANEL(MYPANEL)
IF &LASTCC = 0 THEN +
  WRITE YOU SELECTED: &ZSEL

This capability made CLIST the primary tool for building menu-driven mainframe applications throughout the 1980s and into the 1990s.

Error Handling

CLIST uses the &LASTCC variable to capture the return code of the last executed command, and the ERROR action provides a mechanism for handling error conditions:

1
2
3
4
5
PROC 0
ERROR DO
  WRITE AN ERROR OCCURRED, RETURN CODE: &LASTCC
  RETURN
END

File Operations

CLIST can read from and write to MVS datasets using OPENFILE, GETFILE, PUTFILE, and CLOSFILE commands, enabling file processing directly from the interactive session.

Evolution

CLIST’s evolution has been shaped by the broader trajectory of IBM mainframe operating systems:

  • 1970-1974: Basic CLIST capability as sequential command lists with variable substitution. Limited to simple automation of TSO command sequences.
  • 1975-1984: Addition of structured programming constructs transforms CLIST into a full procedural language. Integration with IBM’s SPF (later renamed ISPF by 1982) adds interactive application development capability.
  • 1985-1988: TSO/E consolidates the environment. REXX arrives as a modern alternative, beginning CLIST’s gradual transition from the primary scripting language to a legacy one.
  • 1988-present: CLIST enters a long maintenance phase. No significant new features are added, but full backward compatibility is maintained across MVS, OS/390, and z/OS. Existing CLISTs continue to run without modification on modern z/OS systems.

Current Relevance

CLIST remains a supported component of TSO/E on IBM z/OS, including the current z/OS 3.1 release. IBM documentation for CLIST continues to be maintained and published. However, CLIST is effectively in legacy status:

  • No new development recommended: IBM has recommended REXX over CLIST for new development since 1988. New mainframe programmers are typically trained in REXX rather than CLIST.
  • Vast installed base: Thousands of CLISTs remain in production across enterprise mainframe installations. Many organizations have CLISTs that have been running for decades, and the cost and risk of rewriting them in REXX is rarely justified.
  • Continued support: IBM has shown no indication of removing CLIST support from z/OS. Both interpreters coexist in TSO/E, and CLISTs written decades ago continue to execute on current systems.

The Open Mainframe Project community forums confirm that CLISTs remain in active use at many organizations, particularly for ISPF-based applications and established automation workflows that predate the adoption of REXX.

Why It Matters

CLIST holds a significant place in mainframe computing history as the original scripting language for interactive mainframe sessions. Before CLIST, mainframe interaction was dominated by batch processing through JCL. CLIST, as part of TSO, helped establish the paradigm of interactive mainframe computing that continues with z/OS today.

The language also illustrates a common pattern in computing history: a practical, domain-specific tool that grows organically from a simple command sequencer into a full programming language through incremental enhancement. CLIST’s evolution from flat command lists to a structured procedural language with ISPF integration mirrors similar trajectories in other command languages, from Unix shell scripts to Windows batch files to PowerShell.

CLIST’s eventual supersession by REXX offers a case study in language succession within a closed ecosystem. While REXX’s documented design influences were EXEC, EXEC 2, and PL/I rather than CLIST directly, CLIST established the interactive scripting use case on TSO that REXX was brought in to fill. Despite REXX’s technical advantages, CLIST persists decades later because the cost of replacing working code rarely justifies the benefits of a newer language — a lesson that applies well beyond the mainframe world.

Timeline

1970
CLIST introduced as part of TSO (Time Sharing Option) in OS/360 Release 20, providing a command procedure language for interactive mainframe sessions
1974
MVS (OS/VS2 Release 2) released; TSO becomes a standard component of the operating system rather than an optional feature
1975
Structured programming constructs (IF-THEN-ELSE, DO loops) added to CLIST in approximately OS/VS2 Release 3.6, significantly expanding its capabilities beyond simple command lists
1980
IBM's Structured Programming Facility (SPF), introduced in the mid-1970s, renamed to System Productivity Facility and later to ISPF (Interactive System Productivity Facility) by 1982, enabling CLISTs to drive panel-based interactive applications with menus and forms
1985
TSO Extensions (TSO/E) released, consolidating and enhancing TSO capabilities including CLIST support
1988
TSO/E Version 2 announced with REXX support, providing an alternative scripting language alongside CLIST; REXX becomes the recommended language for new development
2000
z/OS introduced as the successor to OS/390, continuing full CLIST support in TSO/E as part of the mainframe modernization effort

Notable Uses & Legacy

TSO Command Automation

The primary use of CLIST across thousands of enterprise mainframe installations: automating sequences of TSO commands for system programmers, operators, and application developers.

ISPF Dialog Applications

Used extensively to build interactive panel-driven applications within ISPF, providing menu systems, data entry forms, and workflow automation for mainframe users.

JCL Generation and Job Submission

Widely used to dynamically construct JCL (Job Control Language) streams and submit batch jobs, enabling parameterized and conditional job submission from interactive sessions.

Mainframe System Administration

Employed by systems programmers at banks, insurance companies, government agencies, and other large enterprises for automating administrative tasks such as dataset management, user provisioning, and environment configuration.

Language Influence

Influenced By

JCL

Influenced

Running Today

Run examples using the official Docker image:

docker pull
Last updated: