Modernization Hub

DLL - Dynamic Link Library

Enhanced Definition

A Dynamic Link Library (DLL) in the z/OS environment is a type of load module containing re-entrant, shareable code and data that is loaded into memory and linked at runtime by applications. It promotes modularity, code reuse, and easier maintenance by allowing multiple programs to share a single copy of common routines. In z/OS, DLLs are primarily associated with applications written in C/C++ and typically reside in the hierarchical file system (HFS or zFS). On IBM z/OS, a Dynamic Link Library (DLL) is a type of load module containing re-entrant executable code and data that can be shared by multiple applications at runtime. It promotes code reuse and reduces memory footprint by allowing programs to link to common routines dynamically rather than embedding them statically. In the z/OS context, a Dynamic Link Library (DLL) is a type of executable module containing functions and data that can be used by multiple applications at runtime. It allows code to be shared among different programs without being statically linked into each program's load module, thereby reducing the overall memory footprint and promoting modularity. DLLs are primarily used with Language Environment (LE) enabled applications, especially C/C++ programs running in z/OS UNIX System Services (USS).

Key Characteristics

    • Dynamic Loading: Unlike traditional static linking, DLLs are loaded into memory and linked to an application at runtime, not during the compilation or link-edit phase.
    • Code Reusability: Multiple independent applications can share and execute the same DLL code simultaneously, reducing memory footprint and improving system efficiency.
    • Modularity: DLLs allow developers to segment application functionality into distinct, manageable components, simplifying development and maintenance.
    • Re-entrant Code: For safe execution in a multi-user, multi-tasking z/OS environment, DLL code must be re-entrant, meaning it can be safely executed concurrently by multiple tasks without interfering with each other's data.
    • HFS/zFS Residence: DLLs are typically stored as files within the z/OS UNIX System Services (z/OS UNIX) hierarchical file system (HFS or zFS), unlike traditional load modules found in PDS/PDSE libraries.
    • Language Environment (LE) Dependency: DLLs are heavily reliant on IBM's Language Environment (LE) for their runtime management, including loading, resolution, and execution services.

Use Cases

    • C/C++ Application Development: The standard method for building modular C/C++ applications on z/OS, allowing for the creation of reusable libraries of functions.
    • Shared Utility Functions: Providing common services like data encryption, complex mathematical calculations, or specialized data manipulation routines that can be called by various applications.
    • Middleware Components: Many IBM products and third-party middleware (e.g., DB2, CICS, WebSphere MQ) utilize DLLs for their internal components or to provide interfaces for user exits and extensions.
    • Inter-language Communication: Facilitating calls between programs written in different languages (e.g., a COBOL program calling a C function exposed in a DLL) within the LE environment.
    • System Service Extensions: Developing custom extensions or interfaces to z/OS UNIX System Services or other system-level functionalities.

Related Concepts

A DLL is a specialized type of load module but differs significantly from traditional PDS/PDSE-based load modules due to its dynamic linking nature and typical residence in HFS/zFS. It relies heavily on Language Environment (LE) for its runtime environment, which manages the loading, linking, and execution of DLLs. The Program Management Binder (IEWBLINK) is used to create DLLs, employing specific options to mark them for dynamic linking. DLLs are fundamental to z/OS UNIX System Services applications, where they function similarly to shared libraries on other UNIX-like systems.

Best Practices:
  • Ensure Re-entrancy: Always design and implement DLL code to be re-entrant to guarantee thread safety and prevent data integrity issues in a shared, multi-tasking environment.
  • Manage LIBPATH: Properly configure the LIBPATH environment variable in z/OS UNIX to ensure the system can locate the required DLLs at runtime, or use STEPLIB/JOBLIB for non-HFS based DLLs, though less common.
  • Version Control: Implement robust version control for DLLs to manage updates and ensure compatibility with dependent applications, preventing "DLL hell" scenarios.
  • Minimize Dependencies: Design DLLs with minimal external dependencies to reduce complexity and potential conflicts, making them easier to deploy and maintain.
  • Error Handling: Include comprehensive error handling within DLL functions to provide clear diagnostic information to calling applications in case of issues.
  • Performance Considerations: Optimize DLL code for performance, especially if it's frequently called, as dynamic loading and linking can introduce minor overhead compared to static linking.

Related Products

Related Vendors

IBM

646 products

Macro 4

20 products

Related Categories

Administration

395 products

Operating System

154 products