COMMUNICATING WITH DATABASES - IBM Mainframe

DL/I Database Access

Database Language/I (DL/1) is a database access method of Information Management System (IMS), which is another popular IBM DB/DC control system similar to CICS. The DL/1 database is a hierarchical database constructed for the DL/I database access method.

DL/I Database Access by CICS

DL/I Database Access by CICS

CICS provides an interface to DL/I, independent of IMS in addition to the file control functions performed by the File Control Program. Therefore, this DL/I interface all DL/I services can be used under CICS.

As shown in the above figure, within a CICS region, there is a built-in interface to DL/1. This DL/1 interface communicates with the PL/I database method software included in CICS. In this way, CICS can have a direct control over the DL/1 database, independent of IMS, which means that CICS region itself can manage the DL/1 accesses.

CICS application programs can issue a set of commands for DL/1 services. The DL/1 interface interprets the service requests by the, application program and pass control to the DL/1 access method modules, which actually access the DL/1 database.

DL/I Database Access by CICS

Where function is a DL/1 service and options are the options of the DL/1 service. The CICS application programs issue the DL/1 commands as and when they are required. The CICS command translator translates these DL/1 commands into the proper COBOL statements similar to the CICS commands. Since CICS has direct control over DL/1, in order to utilize DL/1 services, CICS control tables must be defined for the directory of DL/1 Database Descriptions (DBD) and Program Specification Blocks (PSB) through the control table definition macros DFHDLDBD and DFHDLPSB. DBD defines the physical structure of the DL/1 database while the PSB defines the database elements an application is authorized to use. Once these table entries have been defined, the CICS application programs can use the EXEC DLI commands in the program for accessing the DL/1 database.

DB/2 Database Access

DB/2 is IBM's Relational Database Management System (RDBMS) and the database access method for DB/2 is SQL (Structured Query Language). CICS provides an interface to DB/2, but DB/2 requires its own region independent of the CICS region. Therefore the way of interfacing is different from that of DL/1. The way in which CICS accesses DB2 is shown in the following figure.

D62 Database Access by CICS

D62 Database Access by CICS

Both CICS and DB/2 require its own unique regions under the OS. In order to make an interface between CICS and DB/2, DB/2 has a special facility called CICS Attachment Facility, which connects DB/2 to CICS. CICS application programs can issue a set of commands for SQL services in order to access the DB/2 database.

D62 Database Access by CICS

Where 'function' is an SQL function and 'options' is the options of the SQL service. The application programs, which contain EXEC SQL statements, must be Pre-complied using the DB/2 Pre-compiler, which translates the SQL command into COBOL statements. Although CICS translator does not reject the SQL commands as syntax error, the translation time is reduced if the program is pre-compiled first. So the process is shown in the following figure.

Development of CICS-DB2-COBOL Program

Development of CICS-DB2-COBOL Program

The SQL commands that can be used in a CICS application programs are SELECT, FETCH, UPDATE, DELETE and INSERT.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics