In this topic, we described about the below sections -
IMS DB coding in program involves the following steps.
- Program ENTRY statement
- Communication with IMS
- PCB Masks
- IMS database access commands
Let’s discuss about each one separately.
Program Entry Statement:
The program entry statement is a starting point of the program.The program entry statement should be the first executable statement in the program.
It always immediately after the Procedure Division statement for the COBOL programs. This statement used to make IMS to passes control to application program at the entry statement in the program.
It is used to pass the control from the DL/I to the COBOL program. The application program returns control to IMS when finished the program execution (when GOBACK/STOPRUN executed). Program entry statement can be explained in detail here.
Communication with IMS:
As discussed in earlier sections, IMS database is accessed through the Data Language Interface ( i.e. DLI). The DLI interface can be invoked in one of two ways:
- Making a call to IBM supplied program CBLTDLI / ASMTDLI / PLITDLI by Passing a PCB/Passing an AIB
- Invoking the EXEC-DLI CICS interface by Passing a PCB/Passing an AIB.
Communication with IMS topic can be explained in detail here.
PCB used to defines the application view of the database. The PCB (Program Control Block) is the program’s view of database. PCB Mask is the parameter used in the DL/I call.
The order of the PCB mask is second place in DL/I call. PCB mask is always declared in the linkage section. PCB Mask topic can be explained in detail here.
The IO-area is the data area for the segment. The Io-area is the storage location for the segment to be processed which passes to IMS. Io-areas are a two way communication.
For read calls, IMS places the segment retrieved in the Io-area. For update calls, the program must place updated segment in the Io-area and IMS will update the database with updated io-area. IO-Areas topic can be explained in detail here .
Segment Search Arguments:
Segment Search Arguments used to push IMS to correct segment by supplying details such as segment name and key values. SSA parameters are optional parameters. SSA parameters required depending on the type of the call issued. They are used to search data segments inside the IMS database.
SSAs allow the application program to define the type of database access required to IMS. Segment Search Arguments topic can be explained in detail here.