Processing a database record
To process the information in the database, your application program communicates with IMS in three ways: by passing control, by communicating processing requests, and by exchanging information using DL/I calls.
- Passing control—IMS passes control to your application
program through an entry statement in your program. Your program returns control to IMS when it has finished its processing.
When you are running a CICS® online program, CICS passes control to your application program, and your program schedules a PSB to make IMS requests. Your program returns control to CICS. If you are running a batch or BMP program, IMS passes control to your program with an existing PSB scheduled.
- Communicating processing requests—You communicate processing requests to IMS in one of two ways:
- In IMS, you issue DL/I calls to process the database.
- In CICS, you can issue either DL/I calls or EXEC DLI commands. EXEC DLI commands more closely resemble a higher-level language than do DL/I calls.
- Exchanging information using DL/I calls—Your program exchanges information in two areas:
- A DL/I call reports the results of your request in a control block and the AIB communication block when using one of the AIB interfaces. For programs written using DL/I calls, this control block is the DB PCB. For programs written using EXEC DLI commands, this control block is the DLI interface block (DIB). The contents of the DIB reflect the status of the last DL/I command executed in the program. Your program includes a mask of the appropriate control block and uses this mask to check the results of the request.
- When you request a segment from the database, IMS returns the segment to your I/O area. When you want to update a segment in the database, you place the new value of the segment in the I/O area.
An application program can read and update a database. When you update a database, you can replace, delete, or add segments. In IMS, you indicate in the DL/I call the segment you want to process, and whether you want to read or update it. In CICS, you can indicate what you want using either a DL/I call or an EXEC DLI command.