CL for AS/400
IBM's Control Language for the AS/400 (IBM i) platform - the system administration and job control language that has managed IBM midrange operations since 1979.
Created by IBM Rochester Development Laboratory
CL (Control Language) is the system administration and job control language for the IBM i platform, formerly known as the AS/400. Developed by IBM’s Rochester Development Laboratory in Minnesota, CL provides the primary interface to the operating system, managing everything from job scheduling and file operations to user profiles and system configuration. It has been an integral part of IBM’s midrange computing platform since the System/38 launched in 1979.
History & Origins
CL was created as part of the Control Program Facility (CPF), the operating system for the IBM System/38. The System/38 was announced on October 24, 1978, with first customer shipments reportedly beginning in late 1979 or early 1980. CL shipped as part of CPF from the beginning, providing operators and administrators with a consistent, command-driven interface to system resources.
The Rochester Lab
The IBM Rochester Development Laboratory in Rochester, Minnesota was responsible for the System/38 and its successors. Key figures in the System/38 project included Frank Soltis and Glenn Henry, though CL was a product of the broader development team rather than attributed to specific individuals. The System/38 reportedly represented approximately eight years of development work.
From System/38 to AS/400
When IBM launched the AS/400 (Application System/400) in June 1988, CL carried forward as the system control language under the new OS/400 operating system. The transition preserved CL’s command structure while expanding its capabilities to match the AS/400’s broader feature set. This continuity meant that system administrators familiar with CL on the System/38 could transition to the AS/400 with minimal retraining.
Naming Through the Years
The platform has been rebranded several times, but CL has remained the constant system control language throughout:
- System/38 (1979) - CPF
- AS/400 (1988) - OS/400
- iSeries (2000) - OS/400
- System i (2006) - i5/OS
- IBM i (2008-present) - IBM i
Design Philosophy
CL was designed to serve a role analogous to JCL (Job Control Language) on IBM mainframes, but with significantly greater capability as a programming language. Where JCL is primarily a job description language, CL is a full procedural language that can control program flow, handle errors, manipulate data, and interact with nearly every aspect of the operating system.
Verb-Noun Command Structure
CL commands follow a consistent verb-noun naming convention using standardized abbreviations:
| Verb | Meaning | Noun | Meaning |
|---|---|---|---|
| CRT | Create | PGM | Program |
| DSP | Display | USR | User Profile |
| CHG | Change | LIB | Library |
| WRK | Work with | JOBD | Job Description |
| DLT | Delete | OUTQ | Output Queue |
| SND | Send | MSG | Message |
This pattern means that knowing the abbreviation conventions lets administrators predict command names. For example, DSPUSRPRF displays a user profile, CHGJOBD changes a job description, and CRTLIB creates a library.
Named Parameters
Unlike positional-parameter shells such as Unix sh or DOS CMD, CL uses named parameters that can be specified in any order:
| |
Every CL command supports interactive prompting (via the F4 key on a 5250 terminal), which reveals all available parameters, their default values, and valid choices. This makes CL highly discoverable - administrators can explore commands without memorizing parameter lists.
Key Features
Compiled Programs
Although CL is often compared to scripting languages, CL programs are compiled, not interpreted. The CRTCLPGM (OPM) or CRTBNDCL (ILE) command compiles CL source into executable program objects. This generally gives CL programs better runtime performance than typical interpreted scripts.
Variables
Variables are declared with the DCL command and prefixed with an ampersand (&). All declarations must appear at the top of the program, after the PGM command:
| |
Supported data types include:
| Type | Keyword | Description |
|---|---|---|
| Character | *CHAR | Character string (up to 9999 bytes in OPM, 32767 in ILE) |
| Decimal | *DEC | Packed decimal (up to 15 digits in OPM, 24 in ILE) |
| Logical | *LGL | Boolean (‘0’ or ‘1’) |
| Integer | *INT | Signed integer (2, 4, or 8 bytes) - added in V5R3 |
| Unsigned Integer | *UINT | Unsigned integer - added in V5R3 |
| Pointer | *PTR | Pointer variable - added in V5R4 |
Control Structures
CL provides standard control flow constructs, though several were added in later releases:
| |
Message Handling
One of CL’s most distinctive features is its message handling system. Programs communicate through message queues, and the MONMSG command provides exception handling:
| |
The MONMSG command can monitor for specific message IDs or ranges, providing granular error handling similar to try-catch blocks in modern languages.
File Operations
CL can read database files using the DCLF (Declare File) and RCVF (Receive File) commands:
| |
The ILE Era
The introduction of the Integrated Language Environment (ILE) in the mid-1990s was a significant milestone for CL. ILE CL programs (created with CRTBNDCL) gain access to:
- Subprocedures: Modular, callable units within a program
- Service programs: Shared code libraries callable from multiple programs
- Activation groups: Scoping mechanisms for program resources
- Binding: The ability to bind CL modules with RPG, COBOL, and C modules into a single program
ILE allowed CL to participate as a peer alongside RPG, COBOL, and C in mixed-language applications, rather than being limited to a “glue” role calling other programs.
CL’s Role in the IBM i Ecosystem
CL occupies a specific niche in the IBM i language ecosystem:
- RPG handles business application logic and data processing
- COBOL serves legacy batch processing and financial calculations
- CL manages system operations, job control, and program orchestration
- SQL handles database queries and data manipulation
A typical IBM i shop uses CL to schedule jobs, set up runtime environments, manage libraries, handle errors at the system level, and call RPG or COBOL programs that perform the actual business processing. CL programs often serve as the entry point for batch job streams, setting up the environment before calling application programs.
Platform Availability
CL is exclusively tied to the IBM i operating system on IBM Power hardware:
| Platform | Support |
|---|---|
| IBM i (Power Systems) | Full - native environment |
| Windows | Not available |
| macOS | Not available |
| Linux | Not available |
| Docker | No image available |
There is no open-source CL implementation or emulator for other platforms.
Accessing IBM i
To write and run CL programs, you need access to an IBM i system:
- PUB400.COM - A free public IBM i system for learning, with reportedly over 40,000 registered users as of 2024
- IBM Power Virtual Server - Cloud-based IBM i instances on IBM Cloud
- Physical IBM Power hardware - On-premises systems
CL Today
CL remains actively used and enhanced on IBM i. IBM reportedly ships over 2,000 built-in CL commands with the operating system, covering virtually every aspect of system management. IBM i 7.5, released in May 2022, is the current generally available release, and IBM continues to deliver CL enhancements through Technology Refreshes.
The language has evolved considerably from its System/38 origins. Features added in V5R3 (2004) and V5R4 (2006) - including loops, subroutines, pointers, and data structures - transformed CL from a simple command scripting facility into a capable procedural language. While RPG and SQL handle most application development, CL remains indispensable for system administration, job scheduling, and operational automation on the IBM i platform.
Why It Matters
CL represents a design philosophy where the system control language is a first-class, compiled programming language rather than an afterthought scripting facility. Its consistent verb-noun command structure, named parameters, and interactive prompting made it remarkably discoverable for its era. The language demonstrates that system administration tools can be both powerful and learnable when designed with consistent conventions.
As one of the key languages of the IBM midrange ecosystem, CL has quietly powered the operational backbone of thousands of enterprises for over four decades. The businesses that depend on IBM i - in banking, retail, manufacturing, healthcare, and insurance - rely on CL programs to keep their critical systems running.
Timeline
Notable Uses & Legacy
Banking and Financial Services
Core banking operations, transaction processing, and batch job scheduling on IBM i systems at financial institutions worldwide.
Retail and Distribution
System administration for point-of-sale, inventory management, and order fulfillment systems running on IBM i.
Manufacturing
Job scheduling, system automation, and ERP system administration on IBM i-based manufacturing operations.
Healthcare
System operations management for hospital billing, insurance claims processing, and patient records systems on IBM i.
Insurance
Batch processing orchestration and system administration for policy management and claims processing systems.
Language Influence
Influenced By
Running Today
Run examples using the official Docker image:
docker pull noneExample usage:
# CL requires IBM i - no Docker image available