EXECUTE
In the mainframe context, **execution** refers to the process by which the z/OS operating system loads a compiled program (a `load module`) into an address space and begins processing its instructions. It is the act of running a program, job step, or transaction to perform its intended functions, consuming system resources like CPU, memory, and I/O.
Key Characteristics
-
- Initiation: Often triggered by a JCL
EXECstatement for batch jobs, by a user entering a transaction code in an online system like CICS or IMS, or by a TSO command. - Resource Allocation: Requires the z/OS operating system to allocate CPU cycles, virtual storage (memory), and I/O resources (e.g., datasets, devices) for the program's operation.
- Program Loading: Involves loading the executable code (a load module) from a program library (e.g.,
STEPLIB,JOBLIB,LINKLIB) into the program's assigned virtual storage area. - Execution Environment: Programs execute within a specific context, such as a batch job step, a CICS region, an IMS dependent region, a TSO session, or a UNIX System Services (z/OS UNIX) process.
- Return Codes: Upon completion, programs typically issue a return code (e.g.,
CC=0000for successful completion, non-zero for errors) that indicates the outcome of the execution. - Concurrency: z/OS supports concurrent execution of multiple programs and jobs through its multitasking and multiprocessing capabilities, managing their access to shared resources.
- Initiation: Often triggered by a JCL
Use Cases
-
- Batch Job Processing: Executing a COBOL batch program via JCL to process large volumes of data, such as daily payroll runs, nightly report generation, or scheduled database updates.
- Utility Program Execution: Running system utilities like
IDCAMSfor VSAM dataset management,IEBGENERfor copying sequential datasets, orSORTfor data manipulation, often as steps within a JCL job. - Online Transaction Processing: Executing a CICS transaction program (e.g., written in COBOL or Assembler) when a user enters a transaction code, enabling real-time interaction with applications and databases.
- Database Operations: Executing SQL statements embedded within a COBOL-DB2 program or running a DB2 stored procedure to perform complex data retrieval or modification tasks.
- System Commands and Scripts: Executing TSO commands, REXX execs, or ISPF dialogs to perform system administration tasks, develop applications, or automate operational processes.
Related Concepts
Execution is fundamentally linked to JCL (Job Control Language), where the EXEC statement explicitly defines a program or cataloged procedure to be run as a job step. The program itself, often a load module created by the linkage editor from compiled source code (e.g., COBOL, PL/I, Assembler), is the entity that gets executed. The z/OS operating system is responsible for managing the entire execution lifecycle, from scheduling and resource allocation to monitoring and termination. Job Steps are the granular units of execution within a Job, each typically executing one program or procedure.
- Monitor Return Codes: Always check and act upon return codes from executed programs and utilities to ensure successful completion and proper
## F