IMS DB/DC
IMS (Information Management System, 1968 — built for the Apollo program) has two parts:
38.1 Overview
IMS (Information Management System, 1968 — built for the Apollo program) has two parts:
IMS DB: a hierarchical database. Data is stored in segments organized as trees (e.g., CUSTOMER → ACCOUNT → TRANSACTION). Defined by a DBD (database description).
IMS TM (formerly DC): a transaction manager with message queues — programs run as MPP (message processing), BMP (batch message processing), or IFP (fast path).
Programs see only the segments granted by their PSB (program specification block), which contains PCBs (program communication blocks).
38.2 DL/I calls from COBOL
Calls: GU (get unique), GN (get next), GNP (get next within parent), GHU/GHN (get hold, before update), ISRT, REPL, DLET, and CHKP/XRST for checkpoint/restart.
SSAs (segment search arguments) qualify which segment to retrieve: segment name, then (field op value).
Status codes: blank = OK, GE = not found, GB = end of database, II = duplicate insert.
Legacy programs begin with ENTRY "DLITCBL" USING pcb-list; modern ones use PROCEDURE DIVISION USING. Batch DL/I programs run under the region controller DFSRRC00 in JCL. Recent IMS releases also let COBOL programs access IMS databases with SQL, and Java programs use JDBC.
WORKING-STORAGE SECTION.
01 DLI-GU PIC X(4) VALUE "GU ".
01 DLI-GN PIC X(4) VALUE "GN ".
01 CUST-SSA.
05 FILLER PIC X(8) VALUE "CUSTOMER".
05 FILLER PIC X VALUE "(".
05 FILLER PIC X(8) VALUE "CUSTID".
05 FILLER PIC X(2) VALUE " =".
05 SSA-CUST-ID PIC X(6).
05 FILLER PIC X VALUE ")".
01 CUST-SEGMENT.
05 SEG-CUST-ID PIC X(6).
05 SEG-CUST-NAME PIC X(30).
LINKAGE SECTION.
01 CUST-PCB.
05 PCB-DBD-NAME PIC X(8).
05 PCB-SEG-LEVEL PIC XX.
05 PCB-STATUS 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-NUM-SENS PIC S9(5) COMP.
05 PCB-KEY-FB PIC X(20).
PROCEDURE DIVISION USING CUST-PCB.
MOVE "100123" TO SSA-CUST-ID
CALL "CBLTDLI" USING DLI-GU CUST-PCB CUST-SEGMENT CUST-SSA
EVALUATE PCB-STATU
…