Modernization Hub

DBRM - Database Request Module

Enhanced Definition

A Database Request Module (DBRM) is a member in a partitioned dataset (PDS or PDSE) that contains the SQL statements extracted from an application program (e.g., COBOL, PL/I) by the DB2 precompiler. It serves as an intermediate object used by DB2 for z/OS during the bind process to create executable application packages and plans. A `Database Request Module (DBRM)` is an output file generated by the DB2 precompiler when processing an application program containing embedded SQL statements. It contains the parsed SQL statements, host variable definitions, and other information necessary for DB2 to understand and execute the program's database requests. The DBRM acts as an intermediary, translating the application's SQL into a format suitable for the DB2 BIND process.

Key Characteristics

    • Content: Contains all embedded SQL statements from a single source program, along with host variable definitions and other metadata required by DB2.
    • Creation: Generated by the DB2 precompiler (DSNHPC utility) during the application program compilation process, specifically after the SQL statements are removed from the source code.
    • Storage: Stored in a DBRM library, which is a PDS or PDSE, and typically specified as an output dataset during the precompilation step.
    • Bind Input: An essential input to the DB2 BIND PACKAGE and BIND PLAN commands, which transform the DBRM's SQL into an executable form for DB2.
    • Program Specific: Each DBRM corresponds to a single application program module containing embedded SQL.
    • Language Agnostic: Can be generated from various host languages supported by DB2, including COBOL, PL/I, C/C++, and Assembler.

Use Cases

    • Application Development: After a developer writes a COBOL program with embedded SQL, the DBRM is created as a necessary step before the program can interact with DB2.
    • Program Compilation: The DB2 precompiler processes the source code, replaces SQL statements with host language calls, and outputs the DBRM to a specified library.
    • DB2 Package/Plan Creation: DBRMs are used as input to the BIND process to create DB2 packages and plans, which are the executable objects that DB2 uses to run the program's SQL.
    • SQL Statement Management: Provides a structured way for DB2 to manage and optimize the SQL statements from application programs.

Related Concepts

The DB2 precompiler is the utility responsible for creating the DBRM from an application program's source code. The DBRM is then a crucial input to the BIND process, which compiles the SQL into an executable package (a collection of DBRMs for one or more program modules) and ultimately into a plan (a higher-level object that defines the access paths for SQL statements and references packages). Without a DBRM, an application program with embedded SQL cannot be bound and therefore cannot execute its SQL against DB2.

Best Practices:
  • Version Control: Treat DBRMs as critical artifacts; store them in a version control system alongside their corresponding source code to track changes and facilitate rollback.
  • Automated Generation: Integrate DBRM generation into automated build and deployment pipelines to ensure consistency and reduce manual errors.
  • DBRM Library Management: Organize DBRM libraries logically (e.g., by application, environment) and manage their access permissions to maintain security and integrity.
  • Rebinding Strategy: Establish a strategy for rebinding DBRMs (or their associated packages/plans) when underlying DB2 objects (tables, indexes) change, or when DB2 statistics are updated, to ensure optimal access paths and performance.
  • Naming Conventions: Implement clear and consistent naming conventions for DBRMs to easily identify the associated program module and application.

Related Vendors

ABA

3 products

ASE

3 products

IBM

646 products

Broadcom

235 products

UNICOM Systems

35 products

Applied Software

7 products

Related Categories

Databases

211 products

CASE/Code Generation

19 products