Execute Channel Program
| Company type | Macro / System call |
|---|---|
| Industry | Computer software / Operating systems |
| Products | Low-level device interaction in IBM mainframe OS environments |
In IBM mainframe operating system environments, Execute Channel Program (EXCP) refers to a macro that initiates a system call via a Supervisor Call instruction, enabling direct low-level interaction with devices. The developer supplies a channel program, which is essentially a sequence of device-specific commands (CCWs) executed by the I/O channels, control units, and hardware devices. Documentation for EXCP under OS/360 and successors is found in the OS System Programmer's Guide, whereas for DOS/360 and successors, it is covered in DOS Supervisor and I/O Macros. This discussion primarily focuses on OS/360 through z/OS, noting that there are some distinctions for TOS/360 and DOS/360 through z/VSE.
Dataset specification
EXCP facilitates efficient operation of legacy devices and datasets by means of specifying the appropriate control blocks. For OS systems, devices are OPENed through the use of a Data Control Block (DCB), while in DOS environments, the DTFPH serves this purpose.
I/O operation specification
From OS/360 through z/OS, EXCP requires an Input/Output Block (IOB) to be provided; when multiple IOBs are submitted, they are handled sequentially in the order requested. In the case of DASD devices, the IOB contains a seek address field, IOBSEEK, which follows the MBBCCHHR format—where M indicates extent number, BB denotes bin, CCHH specifies cylinder and head, and R represents record number.
Appendages
An appendage is a user-defined routine that grants enhanced control over I/O processes during channel program execution. A detailed catalog of appendages (also known as EXCP user exits) enables authorized software to bypass or supplement system security and data validation mechanisms. Authorization categories include APF-authorized programs operating in privileged states, appendages automatically selected by OPEN for particular access methods, as well as those configured at IPL time within IEAAPP00.
Most appendages maintain backward compatibility with earlier OS versions; however, some functions have been expanded within MVS. These are identified within the DCB by the final two characters of module names following the IGG019xx pattern (where xx ranges from WA to Z9), which are reserved for site-specific appendages; other IGG019xx modules remain designated for IBM access methods. Appendage modules must be stored in SYS1.SVCLIB or SYS1.LPALIB on SVS or later releases.
Preserving dataset integrity
When a program issues an OPEN on a DCB for EXCP use, it generates a Data Extent Block (DEB) that enumerates each extent on the dataset’s primary volume; in cases of parallel mount, this DEB covers all extents across multiple volumes. The DEB is linked to the DCB via chaining, with EXCP validating this linkage as a security precaution because while the DCB resides in unprotected user memory, the DEB is kept within protected system storage (Subpool 253). In OS/VS1 and OS/VS2 environments, EXCP employs DEBCHK to verify the DEB’s authenticity. For DASD devices, EXCP confirms that seek addresses specified in the IOB remain within defined extents and enforces a Set File Mask to regulate orientation and write capabilities—preventing seeks beyond designated tracks or cylinders. Attempts to read past a track trigger a unit check, causing the channel program to restart on the subsequent track. Surpassing an extent boundary activates an end of extent appendage which may modify the IOB and instruct EXCP either to reissue or halt the operation.
Datasets limited to legacy formats
Although often misunderstood as a direct access storage device technique, EXCP functions as a general-purpose low-level interface for device access, accommodating any legacy device category and dataset structure. For broader device and dataset compatibility, systems from MVS/370 onward provide the privileged Start Input/Output (STARTIO) interface, which, however, is not officially supported.
Streamlined handling of direct access datasets
A specialized form, Execute Direct Access Program (XDAP), is designed exclusively for direct access storage to read and modify existing records. XDAP itself cannot insert new records but can be integrated with BSAM or BPAM to facilitate record additions; this approach is employed by several operating system components, such as the Linkage Editor IEWL.
Access to telecommunications devices
EXCP additionally manages communication devices connected through IBM 2701, 2702, 2703 controllers, as well as IBM 370x or Amdahl 470x front-end processors operating in emulator or partitioned emulator configurations.
Interaction with the supervisor
The EXCP front-end consistently runs in Task Control Block (TCB) mode—the standard for application programs—since it is a Type 1 SVC. In MVS/370 and subsequent systems, EXCP calls upon STARTIO to initiate channel program execution. Its back-end operates in Service Request Block (SRB) mode but incorporates emulation routines that allow extensions developed for pre-MVS EXCP to behave as if running in TCB mode. This emulation layer can present challenges when migrating customized access methods and software to MVS environments.
Channel program structure
System/360 channel programs consist of ordered command sequences executed by the channel and I/O device, stored anywhere within main memory. Each program contains Channel Command Words (CCWs), processed sequentially unless interrupted by a branch instruction known as Transfer In Channel (TIC) or a status modifier response. Each CCW is an eight-byte doubleword formatted as follows:
bit 0 7 8 31
+--------+-----------------------+
|Command | Data address |
+--------+-----------------------+
32 36 40 47 48 63
+------+---+--------+------------+
|Flags |000|reserved| count |
+------+---+--------+------------+
Within the command field (bits 0-7), six commands are identified by the low-order bits, while high-order bits act as modifiers or remain unused. The commands include:
0100 - Sense 1000 - Transfer in Channel (TIC) 1100 - Read backward --01 - Write --10 - Read --11 - Control
The data address segment (bits 8-31) indicates a 24-bit main memory buffer designated for data transfer. The flag bits (32-36) dictate command execution specifics:
| Bit | ID | Name | Description |
|---|---|---|---|
| 32 | CD | Chain data | Continue this command using the next CCW's storage area |
| 33 | CC | Chain command | Proceed with the next sequential CCW after this one if CD or CC is set; otherwise end program |
| 34 | SLI | Suppress length indication | Disregard incorrect length indications for this command |
| 35 | SKIP | Skip | Prevent data transfer during this command |
| 36 | PCI | Program controlled interruption | Trigger an interrupt at the start of command execution |
The count field (bits 48-63) specifies the byte quantity to be transferred.
All eight bits of I/O commands are transmitted directly to the device, with modifier bits defining execution parameters. For instance, the write command for the IBM 2305 DASD ('MMMMMM01'BX) may have these specific values:
| Bit value | Hexadecimal | Description |
|---|---|---|
| 0001 1001 | '19'X | Write home address |
| 0001 0101 | '15'X | Write record zero |
| 0001 0001 | '11'X | Erase operation |
| 0001 1101 | '1D'X | Write count, key, and data fields |
| 0000 0001 | '01'X | Write special count, key, and data fields |
| 0000 0101 | '05'X | Write data only |
| 0000 1101 | '0D'X | Write key and data fields |
References
- S/360
- S/370
- S/370-XA
- z/ARCH
- DFSMSdfp