Build
In the mainframe context, "building" refers to the multi-step process of transforming source code (e.g., COBOL, PL/I, Assembler) into an executable program. This typically involves **compilation**, which translates high-level source code into machine-readable object code, and **linking**, which resolves external references and combines object code into a runnable load module.
Key Characteristics
-
- Compilation: Translates high-level language source code (e.g., COBOL, PL/I, Assembler) into machine-readable object code. This process checks for syntax errors and generates an object module (often a
.OBJor.TEXTmember in a PDS or PDSE). - Linking: Takes one or more object modules and resolves external references (e.g., calls to subroutines, library functions) to create a load module (an executable program). This is performed by the Linkage Editor (
IEWL) or Binder. - Load Module: The final output of the build process, stored in a Program Library (e.g.,
STEPLIB,JOBLIB,LINKLIB). It's ready to be loaded into memory and executed. - JCL-driven: The entire build process on z/OS is typically orchestrated using Job Control Language (JCL), defining the steps, input/output datasets, and utility programs (compiler, linkage editor).
- Batch Processing: Often executed as a batch job, allowing for automated and repeatable builds, especially for large applications or during continuous integration/delivery pipelines.
- Dependency Management: Requires careful management of source code, copybooks, include files, and library dependencies to ensure a successful and correct build.
- Compilation: Translates high-level language source code (e.g., COBOL, PL/I, Assembler) into machine-readable object code. This process checks for syntax errors and generates an object module (often a
Use Cases
-
- New Program Development: Creating the initial executable version of a newly written COBOL, PL/I, or Assembler program.
- Program Maintenance/Enhancement: Rebuilding an existing program after code changes, bug fixes, or feature additions to deploy updated functionality.
- Application Deployment: Preparing an application for deployment to different environments (e.g., test, QA, production) by ensuring all components are correctly compiled and linked.
- Library Updates: Rebuilding programs that depend on shared copybooks or subroutines after those shared components have been modified to incorporate the latest versions.
Related Concepts
The build process is fundamental to application development on z/OS. It relies heavily on JCL to define the compilation and linking steps, utilizing utilities like the COBOL compiler (IGYCRCTL), PL/I compiler (IBMDPCL), Assembler (ASMA90), and the Linkage Editor/Binder (IEWL). The resulting load modules are then executed by batch jobs, invoked by CICS transactions, or called by other programs, making them the core executable units of z/OS applications. This process is often integrated with Source Code Management (SCM) systems like Endevor or CA-Librarian.
- Automate with JCL: Use standardized JCL procedures (
PROCs) for compilation and linking to ensure consistency, repeatability, and reduce manual errors across projects and environments. - Version Control Integration: Integrate the build process with a Source Code Management (SCM) system to manage source code versions, track changes, and ensure the correct source is used for each build.
- Separate Compile and Link: Often, it's beneficial to separate the compile and link steps in JCL, especially during development, to allow for easier debugging of compilation errors before attempting to link.
- Use PDSEs for Load Libraries: Utilize Partitioned Data Set Extended (PDSEs) for load libraries where possible, as they offer better space management, concurrency, and support for larger member sizes compared to traditional PDSs.
- Manage Dependencies Explicitly: Clearly document and manage all program dependencies (copybooks, subroutines, external libraries) to prevent build failures due to missing or incorrect components.
- Implement Error Handling: Use JCL
CONDparameters to prevent subsequent steps from executing if a compile or link step fails, ensuring that only successfully built programs are processed further.