Modernization Hub

Compilation

Enhanced Definition

Compilation is the process of translating human-readable source code, written in a high-level programming language like COBOL, PL/I, or C/C++, into machine-executable object code. On z/OS, this involves a specific compiler program reading the source code, performing syntax and semantic analysis, and generating an object module suitable for subsequent linking. Compilation is the process on IBM z/OS systems where source code, written in high-level programming languages like COBOL, PL/I, or C/C++, is translated into machine-executable object code. Its primary purpose is to transform human-readable program logic into a format that the z/Architecture processor can understand and execute, typically as a preparatory step for link-editing.

Key Characteristics

    • Input: Source code files, typically stored as members in Partitioned Data Sets (PDS) or Partitioned Data Set Extended (PDSE), or as files in Hierarchical File System (HFS)/zFS.
    • Output: An object module, which is a partially linked program containing machine instructions and unresolved external references, usually stored in a PDS/PDSE member.
    • Compiler Programs: Specific IBM compilers are used, such as IGYCRCTL for COBOL, IBMCLG for PL/I, and CBCRCTL for C/C++.
    • JCL Integration: The compilation process is driven by Job Control Language (JCL), using EXEC PGM= statements to invoke the compiler and DD statements to define input source, output object module, and compiler options.
    • Diagnostic Output: Compilers generate a SYSPRINT listing file containing the source code, compiler options used, cross-reference listings, and critical diagnostic messages (warnings and errors).
    • Compiler Options: A wide array of options can be passed to the compiler (e.g., OPTIMIZE, TEST, RENT, FLAG) to control aspects like code optimization, debugging information, reentrancy, and message severity.

Use Cases

    • Application Development: The fundamental step for transforming newly written or modified COBOL, PL/I, or C/C++ programs into an executable form for testing and deployment.
    • Program Maintenance: Recompiling existing applications after bug fixes, performance tuning, or the addition of new features to generate updated object modules.
    • Batch Job Preparation: Often part of a multi-step JCL job stream (e.g., COMPILE, LINK, GO) to build and execute batch applications on z/OS.
    • CICS/DB2 Program Preparation: For programs interacting with CICS or DB2, a precompiler or translator typically runs *before* the main compilation step to convert embedded commands (e.g., EXEC CICS, EXEC SQL) into standard host language calls.

Related Concepts

Compilation is the precursor to the linkage editor step, which takes the object module produced by the compiler and resolves external references to create a final executable load module. For programs using DB2 or CICS, a precompiler or translator executes *before* the main compiler to convert specialized statements into standard language constructs that the compiler can understand. The entire process is orchestrated by JCL, which defines the compiler to use, its inputs, outputs, and specific options.

Best Practices:
  • Specify Appropriate Compiler Options: Always use relevant PARM options (e.g., OPTIMIZE(2), TEST, RENT, FLAG(I,W)) to optimize code, enable debugging, ensure reentrancy, and control diagnostic message levels.
  • Review Compiler Listings: Thoroughly examine the SYSPRINT output for all warnings and errors, as even warnings can indicate potential issues or inefficient code.
  • Integrate with SCM: Incorporate compilation into a Software Configuration Management (SCM) system to automate builds, manage different versions of source code, and ensure consistent compilation environments.
  • Monitor Return Codes: Check the MAXCC (Maximum Condition Code) of the compilation step; a MAXCC of 0 or 4 is typically acceptable, while 8 or higher indicates serious errors that prevent successful execution.
  • Separate Compile and Link Steps: Maintain distinct COMPILE and LINK steps in your JCL procedures for better modularity, easier debugging, and more flexible build processes.

Related Vendors

IBM

646 products

Broadcom

235 products

Trax Softworks

3 products

Related Categories

CASE/Code Generation

19 products

Operating System

154 products

Browse and Edit

64 products