English 中文(简体)
IMS DB - Programming
  • 时间:2024-11-03

IMS DB - Programming


Previous Page Next Page  

An apppcation program which includes DL/I calls cannot execute directly. Instead, a JCL is required to trigger the IMS DL/I batch module. The batch initiapzation module in IMS is DFSRRC00. The apppcation program and the DL/I module execute together. The following diagram shows the structure of an apppcation program which includes DL/I calls to access a database.

DL Module

The apppcation program interfaces with IMS DL/I modules via the following program elements −

    An ENTRY statement specifies that the PCBs are utipzed by the program.

    A PCB-mask co-relates with the information preserved in the pre-constructed PCB which receives return information from the IMS.

    An Input-Output Area is used for passing data segments to and from the IMS database.

    Calls to DL/I specify the processing functions such as fetch, insert, delete, replace, etc.

    Check Status Codes is used to check the SQL return code of the processing option specified to inform whether the operation was successful or not.

    A Terminate statement is used to end the processing of the apppcation program which includes the DL/I.

Segments Layout

As of now, we learnt that the IMS consists of segments which are used in high-level programming languages to access data. Consider the following IMS database structure of a Library which we have seen earper and here we see the layout of its segments in COBOL −

Layout

01 LIBRARY-SEGMENT.
   05 BOOK-ID        PIC X(5).
   05 ISSUE-DATE     PIC X(10).
   05 RETURN-DATE    PIC X(10).
   05 STUDENT-ID     PIC A(25).
	
01 BOOK-SEGMENT.
   05 BOOK-ID        PIC X(5).
   05 BOOK-NAME      PIC A(30).
   05 AUTHOR         PIC A(25).
	
01 STUDENT-SEGMENT.
   05 STUDENT-ID     PIC X(5).
   05 STUDENT-NAME   PIC A(25).
   05 DIVISION       PIC X(10).

Apppcation Program Overview

The structure of an IMS apppcation program is different from that of a Non-IMS apppcation program. An IMS program cannot be executed directly; rather it is always called as a subroutine. An IMS apppcation program consists of Program Specification Blocks to provide a view of the IMS database.

The apppcation program and the PSBs pnked to that program are loaded when we execute an apppcation program which includes IMS DL/I modules. Then the CALL requests triggered by the apppcation programs are executed by the IMS module.

IMS Services

The following IMS services are used by the apppcation program −

    Accessing database records

    Issuing IMS commands

    Issuing IMS service calls

    Checkpoint calls

    Sync calls

    Sending or receiving messages from onpne user terminals

Advertisements