IMS BMP: Batch Message Processing Programs
IMS BMP (Batch Message Processing) programs occupy a unique position — they are batch programs that can access both IMS databases and the IMS message queue simultaneously. BMPs bridge the gap between pure batch database processing and online transaction processing, making them essential for high-volume update jobs that must coexist with online activity.
What Makes BMP Different
A standard IMS batch program (running in a DLI region) can access IMS databases but cannot touch the IMS message queue. A pure MPP program can access the queue and databases but runs in an online region with all the constraints that implies.
BMP programs can:
- Read from and write to the IMS message queue (like MPPs)
- Access IMS databases (like batch programs)
- Run while online IMS TM is active
- Process large volumes of records with checkpointing
- Run without consuming MPP region capacity
This makes BMPs ideal for: end-of-day batch jobs that need queue access, batch programs that trigger online transactions, and high-volume updates that cannot wait for the online system to quiesce.
BMP Region Structure
BMP programs run in a BMP region — a separate z/OS address space connected to the IMS Control Region. The BMP region:
- Connects to the IMS Control Region at startup
- Competes with online transactions for database locks (but at lower priority by default)
- Has its own PSB with IOPCB for message queue access
- Supports checkpoint/restart for long-running jobs
BMP Program Structure
A BMP program looks very similar to an MPP program — it has an IOPCB as the first PCB:
IDENTIFICATION DIVISION.
PROGRAM-ID. BMPUPD01.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 DLI-FUNCTIONS.
05 GU-FUNC PIC X(4) VALUE 'GU '.
05 GN-FUNC PIC X(4) VALUE 'GN '.
05 ISRT-FUNC PIC X(4) VALUE 'ISRT'.
05 CHKP-FUNC PIC X(4) VALUE 'CHKP'.
05 XRST-FUNC PIC X(4) VALUE 'XRST'.
01 WS-CHKP-ID PIC X(8) VALUE 'BMPUPD01'.
01 WS-CHKP-LEN PIC S9(5) COMP VALUE +0.
01 WS-RECORD-COUNT PIC 9(9) VALUE ZERO.
LINKAGE SECTION.
01 IOPCB.
05 IOPCB-LTERM PIC X(8).
05 FILLER PIC XX.
05 IOPCB-STATUS PIC XX.
05 FILLER PIC X(20).
01 ACCOUNT-PCB.
05 PCB-DBD-NAME PIC X(8).
05 PCB-SEG-LEVEL PIC XX.
05 PCB-STATUS-CODE PIC XX.
05 PCB-PROC-OPT PIC X(4).
05 FILLER PIC S9(5) COMP.
05 PCB-SEG-NAME PIC X(8).
05 PCB-KEY-LEN PIC S9(5) COMP.
05 PCB-NSEN-SEGS PIC S9(5) COMP.
05 PCB-KEY-FBCK PIC X(25).
PROCEDURE DIVISION USING IOPCB ACCOUNT-PCB.
0000-MAIN.
PERFORM 0100-RESTART-CHECK.
PERFORM 1000-PROCESS-ACCOUNTS.
STOP RUN.Checkpoint and Restart in BMP
Long-running BMP programs must use checkpoint/restart to handle abends without reprocessing from the beginning. IMS provides two calls for this:
CHKP (Checkpoint): Commits all database changes, writes a checkpoint record to the IMS log, and optionally saves program data.
* Issue checkpoint every 1000 records
ADD 1 TO WS-RECORD-COUNT.
IF WS-RECORD-COUNT > 0 AND
FUNCTION MOD(WS-RECORD-COUNT, 1000) = 0
CALL 'CBLTDLI' USING CHKP-FUNC
IOPCB
WS-CHKP-ID
WS-CHKP-LEN.XRST (Extended Restart): On restart after an abend, repositions the database to the last checkpoint and restores saved program data.
0100-RESTART-CHECK.
CALL 'CBLTDLI' USING XRST-FUNC
IOPCB
WS-CHKP-ID
WS-CHKP-LEN.
*> If IMS finds a checkpoint, it repositions
*> automatically. Program continues from last CHKP.BMP JCL
BMP programs run with the IMS batch region controller DFSRRC00 with BMP specified:
//BMPJOB EXEC PGM=DFSRRC00,
// PARM='BMP,BMPUPD01,BMPPSB,1024,,,,,,,,,Y'
// * ^program ^PSB name
//DFSRESLB DD DSN=IMS.SDFSRESL,DISP=SHR
//IMS DD DSN=IMS.PSBLIB,DISP=SHR
// DD DSN=IMS.DBDLIB,DISP=SHR
//ACCOUNTDB DD DSN=IMS.DATABASE.ACCTDB,DISP=SHR
//SYSOUT DD SYSOUT=*The third parameter in PARM is the PSB name. The PSB must include an IOPCB.
Frequently Asked Questions
Q: Can a BMP program read from the IMS message queue? Yes. BMPs can both read from and write to the IMS message queue using GU/GN on the IOPCB (reading) and ISRT on the IOPCB (writing). This is the primary distinction from a pure DLI batch program. A common use case is a BMP that processes transaction codes queued by online programs — acting as a delayed batch processor for high-volume updates.
Q: How does a BMP interact with online transactions for database locks? BMPs compete with MPP regions for IMS database locks at a lower scheduling class by default. During heavy online periods, the BMP may experience lock waits. The BMP's scheduling class priority can be tuned in the IMS system definition to balance batch throughput against online response time.
Q: What is the IMSID parameter in BMP JCL? IMSID identifies which IMS control region the BMP should connect to in environments where multiple IMS systems run on the same z/OS image. In single-IMS environments it can default. In complex multi-IMS environments (common at large banks), IMSID ensures the BMP connects to the correct IMS instance.
Part of the IMS Mastery Course — Module 18 of 22.
