Modernization Hub

Compiler

Enhanced Definition

A compiler is a specialized program that translates source code written in a high-level programming language (such as COBOL, PL/I, C/C++, or Java) into an executable machine-code program or object code. In the mainframe/z/OS context, its primary purpose is to enable applications developed by programmers to be understood and executed directly by the mainframe's hardware and operating system.

Key Characteristics

    • Language-Specific: Each compiler is designed to process a particular source language, for example, the IBM COBOL for z/OS compiler processes COBOL source code, while IBM Enterprise PL/I for z/OS handles PL/I.
    • Generates Object Code: The primary output is an object module (or program object in a PDSE), which contains machine instructions but is not directly executable until it is processed by a Linkage Editor or Binder.
    • Syntax and Semantic Checking: It performs extensive analysis of the source code to identify and report syntax errors, semantic errors, and potential logical issues, providing diagnostic messages to the programmer.
    • Optimization Capabilities: Modern compilers include sophisticated optimizers that analyze the source code and generated machine code to improve program performance (e.g., faster execution, reduced CPU cycles, lower memory footprint).
    • Batch Job Execution: On z/OS, compilation is most commonly executed as a step within a JCL (Job Control Language) batch job, often preceding a link-edit or bind step.
    • Compiler Options: Provides a rich set of options that control various aspects of the compilation process, such as optimization levels, generation of debugging information, creation of compiler listings, and error handling.

Use Cases

    • Application Development: Translating newly written COBOL, PL/I, C/C++, or Java source code into executable modules for new business applications.
    • Application Maintenance: Recompiling modified source code for existing mainframe applications after bug fixes, enhancements, or system upgrades to incorporate changes.
    • Performance Tuning: Using different compiler optimization levels or specific options to generate more efficient code for critical batch jobs or online transactions to improve throughput and reduce resource consumption.
    • Debugging and Analysis: Generating detailed compiler listings that show the source code, generated machine code, data maps, and diagnostic messages, which are crucial for debugging and understanding program behavior.

Related Concepts

A compiler is a fundamental component in the z/OS software development lifecycle. Its output, the object module, serves as input to the Linkage Editor or Binder (e.g., IEWBLINK or IEWBLI), which resolves external references and combines multiple object modules and library routines into an executable load module or program object. This load module is then stored in a load library (a PDS or PDSE) and can be executed by the z/OS operating system, often invoked via JCL or by online transaction managers like CICS or IMS TM.

Best Practices:
  • Utilize Appropriate Compiler Options: Select compiler options that align with the program's lifecycle stage (e.g., TEST for development and debugging, OPTIMIZE(2) or OPTIMIZE(3) for production for performance).
  • Review Compiler Listings: Always examine the compiler listing for warnings, errors, and optimization reports to ensure code quality, identify potential issues, and understand generated code characteristics.
  • Keep Compilers Current: Regularly update to the latest versions of IBM compilers to leverage new language features, performance enhancements, security fixes, and support for newer hardware capabilities.
  • Integrate into CI/CD: Automate the compilation process as part of modern DevOps and CI/CD pipelines on z/OS to ensure consistent builds, improve quality, and accelerate delivery.
  • Understand Program Attributes: For programs running in shared environments like CICS or IMS TM, ensure they are compiled with appropriate options (e.g., RENT for reentrancy, THREAD for thread-safety) to allow multiple users to safely share a single copy of the code.

Related Vendors

IBM

646 products

Codemist

1 product

Software AG

51 products

Raincode

7 products

Related Categories

Programming Language

104 products

REXX

23 products

Performance

171 products

UNIX and Windows

141 products