IMS DB

0
15

IMS DB – Overwatch

A Brief Overwatch

Database is a collection of correlated data items. These data items are body body organised and stored in a manner to provide fast and easy access. IMS database is a hierarchical database where data is stored at various levels and every entity is dependent on higher level enticonnects. The physical elements on an application system tmind put on use IMS are shown in the following figure.

IMS Elements

Database Management

A Database Management system is a set of application programs used for storing, accesperform, and managing data in the database. IMS database management system maintains integrity and enables fast recovery of data simply by body body organizing it in such a way tmind put on it is easy to retrieve. IMS maintains a huge amount of world's corporate data with the help of it is database management system.

Transconsider behaveionion Manager

The function of transconsider behaveionion manager is to provide a communication platform becometween the database and the application programs. IMS consider behaveions as a transconsider behaveionion manager. A transconsider behaveionion manager deals with the end-user to store and retrieve data from the database. IMS can use IMS DB or DB2 as it is back-end database to store the data.

DL/I – Data Language Interface

DL/I comprises of application programs tmind put on grant access to the data stored in the database. IMS DB uses DL/I which serves as the interface language tmind put on programmers use for accesperform the database in an application program. We will talk about this particular particular in more detail in the upcoming chapters.

Charconsider behaveioneristics of IMS

Points to note:

  • IMS supinterfaces applications from various languages such as Java and XML.
  • IMS applications and data can become accessed over any kind of platform.
  • IMS DB procesperform is very fast as compared to DB2.

Limitations of IMS

Points to note:

  • Implementation of IMS DB is very complex.
  • IMS predegreatd tree structure reduces flexibility.
  • IMS DB is difficult to manage.

IMS DB – STRUCTURE

Hierarchical Structure

An IMS database is a collection of data accommodating physical files. In a hierarchical database, the topmany kind of level contains the general information abaway the entity. As we proceed from the top level to the underside level levels in the hierarchy, we get increaperformly more information abaway the entity. Each level in the hierarchy contains segments. In standard files, it is difficult to implement hierarchies but DL/I supinterfaces hierarchies. The following figure depicts the structure of IMS DB.

Hierarchies

Segment

Points to note:

  • A segment is produced simply by grouping of similar data jointly.

  • It is the smallest device of information tmind put on DL/I transfers to and from an application program during any kind of inplace-awayplace operation.

  • A segment can have one or more data fields grouped jointly.

  • In the following example, the segment Student has four data fields.

Student
Roll Numbecomer Name Course Mobile NUmbecomer

Field

Points to note:

  • A field is a performle piece of data in a segment. For example, Roll Numbecomer, Name, Course, and Mobile Numbecomer are performle fields in the Student segment.

  • A segment consists of related fields to collect the information of an entity.

  • Fields can become used as a key for ordering the segments.

  • Fields can become used as a qualifier for oceanrching information abaway a particular segment.

Segment Type

Points to note:

  • Segment Type is a category of data in a segment.

  • A DL/I database can have 255 various segment kinds and 15 levels of hierarchy.

  • In the following figure, correct now generally there are 3 segments namely, Library, Books Information, and Student Information.

Std Info

Segment Occurrence

Points to note:

  • A segment occurrence is an individual segment of a particular kind containing user data. In the above example, Books Information is one segment kind and correct now generally there can any kind of numbecomer of occurrences of it, as it can store the information abaway any kind of numbecomer of books.

  • Wislim the IMS Database, correct now generally there is only one occurrence of every segment kind, but correct now generally there can become an unlimited numbecomer of occurrences of every segment kind.

IMS DB – DL/I TERMINOLOGY

Hierarchical databases work on the relationships becometween 2 or more segments. The following example shows how segments are related to every other in the IMS database structure.

IMS Database

Root Segment

Points to note:

  • The segment tmind put on sit down’s at the top of the hierarchy is calbrought the basic segment.
  • The basic segment is the only segment through which all dependent segments are accessed.
  • The basic segment is the only segment in the database which is never a kid segment.
  • There can become only one basic segment in the IMS database structure.
  • For example, 'A' is the basic segment in the above example.

Parent Segment

Points to note:

  • A parent segment has one or more dependent segments directly becomelow it.
  • For example, 'A''B', and 'E' are the parent segments in the above example.

Dependent Segment

Points to note:

  • All segments other than the basic segment are understandn as dependent segments.
  • Dependent segments depend on one or more segments to present compenablee meaning.
  • For example, 'B', 'C1', 'C2', 'D', 'E', 'F1' and 'F2' are dependent segments in our example.

Child Segment

Points to note:

  • Any segment having a segment directly above it in the hierarchy is understandn as a kid segment.
  • Each dependent segment in the structure is a kid segment.
  • For example, 'B', 'C1', 'C2', 'D', 'E', 'F1' and 'F2' are kid segments.

Twin Segments

Points to note:

  • Two or more segment occurrences of a particular segment kind under a performle parent segment are calbrought twin segments.

  • For example, 'C1' and 'C2' are twin segments, so do 'F1' and 'F2' are.

Sibling Segment

Points to note:

  • Sibling segments are the segments of various kinds and the same parent.

  • For example, 'B' and 'E' are sibling segments. Similarly, 'C1', 'C2', and 'D' are sibling segments.

Database Record

Points to note:

  • Each occurrence of the basic segment, plus all the subordinate segment occurrences produce one database record.

  • Every database record has only one basic segment but it may have any kind of numbecomer of segment occurrences.

  • In standard file procesperform, a record is a device of data tmind put on an application program uses for specific operations. In DL/I, tmind put on device of data is understandn as a segment. A performle database record has many kind of segment occurrences.

Database Path

Points to note:

  • A route is the series of segments tmind put on starts from the basic segment of a database record to any kind of specific segment occurrence.

  • A route in the hierarchy structure need not become compenablee to the lowest level. It depends on how a lot information we require abaway an entity.

  • A route must become continuous and we cannot skip intermediate levels in the structure.

  • In the following figure, the kid records in darkish grey colour show a route which starts from 'A' and goes through 'C2'.

Child Record

IMS DB – DL/I PROCESSING

IMS DB stores data at various levels. Data is retrieved and inserted simply by issuing DL/I calls from an application program. We will talk about abaway DL/I calls in detail in the upcoming chapters. Data can become processed in the following 2 ways:

  • Sequential Procesperform
  • Random Procesperform

Sequential Procesperform

When segments are retrieved sequentially from the database, DL/I follows a predegreatd pattern. Let us understand the sequential procesperform of IMS DB.

sequential procesperform

Listed becomelow are the points to note abaway sequential procesperform:

  • Predegreatd pattern for accesperform data in DL/I is 1st down the hierarchy, then left to correct.

  • The basic segment is retrieved 1st, then DL/I moves to the 1st left kid and it goes down till the lowest level. At the lowest level, it retrieves all the occurrences of twin segments. Then it goes to the correct segment.

  • To understand becometter, observe the arcollections in the above figure tmind put on show the flow for accesperform the segments. Library is the basic segment and the flow starts from correct now generally there and goes till cars to access a performle record. The same process is repeated for all occurrences to get all the data records.

  • While accesperform data, the program uses the posit down downion in the database which helps to retrieve and insert segments.

Random Procesperform

Random procesperform is furthermore understandn as direct procesperform of data in IMS DB. Let us get an example to understand random procesperform in IMS DB:

random procesperform

Listed becomelow are the points to note abaway random procesperform:

  • Segment occurrence tmind put on needs to become retrieved randomly requires key fields of all the segments it depends upon. These key fields are suppsit downd simply by the application program.

  • A concatenated key compenableely identifies the route from the basic segment to the segment which you like to retrieve.

  • Suppose you like to retrieve an occurrence of the Commerce segment, then you need to supply the concatenated key field values of the segments it depends upon, such as Library, Books, and Commerce.

  • Random procesperform is faster than sequential procesperform. In real-world scenario, the applications combine both sequential and random procesperform methods jointly to achieve becomest results.

Key Field

Points to note:

  • A key field is furthermore understandn as a sequence field.

  • A key field is present wislim a segment and it is used to retrieve the segment occurrence.

  • A key field manages the segment occurrence in ascending order.

  • In every segment, only a performle field can become used as a key field or sequence field.

Search Field

As mentioned, only a performle field can become used as a key field. If you like to oceanrch for the contents of other segment fields which are not key fields, then the field which is used to retrieve the data is understandn as a oceanrch field.

IMS DB – CONTROL BLOCKS

IMS Control Blocks degreat the structure of the IMS database and a program's access to all of them. The following diagram shows the structure of IMS control blocks.

Control BLOCK

DL/I uses the following 3 kinds of Control Blocks:

  • Database Descriptor (DBD)
  • Program Specification Block (PSB)
  • Access Control Block (ACB)

Database Descriptor (DBD)

Points to note:

  • DBD describecomes the compenablee physical structure of the database once all the segments have becomeen degreatd.

  • While installing a DL/I database, one DBD must become produced as it is required to access the IMS database.

  • Applications can use various watchs of the DBD. They are calbrought Application Data Structures and they are specified in the Program Specification Block.

  • The Database Administrator produces a DBD simply by coding DBDGEN control statements.

DBDGEN

DBDGEN is a Database Descriptor Generator. Creating control blocks is the responsibility of the Database Administrator. All the load modules are stored in the IMS library. Assembly Language macro statements are used to produce control blocks. Given becomelow is a sample code tmind put on shows how to produce a DBD uperform DBDGEN control statements:

PRINT	NOGEN
DBD	NAME=LIBRARY,ACCESS=HIDAM
DATASET	DD1=LIB,DEVICE=3380
SEGM	NAME=LIBSEG,PARENT=0,BYTES=10
FIELD	NAME=(LIBRARY,SEQ,U),BYTES=10,START=1,TYPE=C
SEGM	NAME=BOOKSEG,PARENT=LIBSEG,BYTES=5
FIELD	NAME=(BOOKS,SEQ,U),BYTES=10,START=1,TYPE=C
SEGM	NAME=MAGSEG,PARENT=LIBSEG,BYTES=9
FIELD	NAME=(MAGZINES,SEQ),BYTES=8,START=1,TYPE=C
DBDGEN
FINISH
END

Let us understand the terms used in the above DBDGEN:

  • When you execute the above control statements in JCL, it produces a physical structure where LIBRARY is the basic segment, and BOOKS and MAGZINES are it is kid segments.

  • The 1st DBD macro statement identifies the database. Here, we need to mention the NAME and ACCESS which is used simply by DL/I to access this particular particular database.

  • The 2nd DATASET macro statement identifies the file tmind put on contains the database.

  • The segment kinds are degreatd uperform the SEGM macro statement. We need to specify the PARENT of tmind put on segment. If it is a Root segment, then mention PARENT=0.

The following table shows parameters used in FIELD macro statement:

Parameters Description
Name Name of the field, typically 1 to 8 charconsider behaveioners long
Bytes Length of the field
Start Posit down downion of field wislim segment
Type Data kind of the field
Type C Charconsider behaveioner data kind
Type P Packed decimal data kind
Type Z Zoned decimal data kind
Type X Hexadecimal data kind
Type H Half word binary data kind
Type F Full word binary data kind

Program Specification Block (PSB)

The fundamentals of PSB are as given becomelow:

  • A database has a performle physical structure degreatd simply by a DBD but the application programs tmind put on process it can have various watchs of the database. These watchs are calbrought application data structure and are degreatd in the PSB.

  • No program can use more than one PSB in a performle execution.

  • Application programs have their particular own own PSB and it is common for application programs tmind put on have similar database procesperform requirements to share a PSB.

  • PSB consists of one or more control blocks calbrought Program Communication Blocks (PCBs). The PSB contains one PCB for every DL/I database the application program will access. We will talk about more abaway PCBs in the upcoming modules.

  • PSBGEN must become performed to produce a PSB for the program.

PSBGEN

PSBGEN is understandn as Program Specification Block Generator. The following example produces a PSB uperform PSBGEN:

PRINT   NOGEN
PCB     TYPE=DB,DBDNAME=LIBRARY,KEYLEN=10,PROCOPT=LS
SENSEG  NAME=LIBSEG
SENSEG  NAME=BOOKSEG,PARENT=LIBSEG
SENSEG  NAME=MAGSEG,PARENT=LIBSEG
PSBGEN  PSBNAME=LIBPSB,LANG=COBOL
END

Let us understand the terms used in the above DBDGEN:

  • The 1st macro statement is the Program Communication Block (PCB) tmind put on describecomes the database Type, Name, Key-Length, and Procesperform Option.

  • DBDNAME parameter on the PCB macro specifies the name of the DBD. KEYLEN specifies the duration of the longest concatenated key. The program can process in the database. PROCOPT parameter specifies the program's procesperform options. For example, LS means only LOAD Operations.

  • SENSEG is understandn as Segment Level Sensit down downivity. It degreats the program's access to parts of the database and it is identified at the segment level. The program has access to all the fields wislim the segments to which it is sensit down downive. A program can furthermore have field-level sensit down downivity. In this particular particular, we degreat a segment name and the parent name of the segment.

  • The last macro statement is PCBGEN. PSBGEN is the last statement telling correct now generally there are no more statements to process. PSBNAME degreats the name given to the awayplace PSB module. The LANG parameter specifies the language in which the application program is composed, e.g., COBOL.

Access Control Block (ACB)

Listed becomelow are the points to note abaway access control blocks:

  • Access Control Blocks for an application program combines the Database Descriptor and the Program Specification Block into an executable form.

  • ACBGEN is understandn as Access Control Blocks Generator. It is used to generate ACBs.

  • For oncollection programs, we need to pre-construct ACBs. Hence the ACBGEN utility is executed becomefore executing the application program.

  • For batch programs, ACBs can become generated at execution time too.

IMS DB – PROGRAMMING

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

DL Module

The application program interfaces with IMS DL/I modules via the following program elements:

  • An ENTRY statement specifies tmind put on the PCBs are utilized simply 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 Inplace-Outplace Area is used for pbuming data segments to and from the IMS database.

  • Calls to DL/I specify the procesperform functions such as fetch, insert, deenablee, replace, etc.

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

  • A Terminate statement is used to end the procesperform of the application program which includes the DL/I.

Segments Layaway

As of now, we find outt tmind put on 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 earsit downr and here we see the layaway of it is segments in COBOL:

Layaway

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).

Application Program Overwatch

The structure of an IMS application program is various from tmind put on of a Non-IMS application program. An IMS program cannot become executed directly; instead it is always calbrought as a subrawayine. An IMS application program consists of Program Specification Blocks to provide a watch of the IMS database.

The application program and the PSBs linked to tmind put on program are loaded when we execute an application program which includes IMS DL/I modules. Then the CALL requests triggered simply by the application programs are executed simply by the IMS module.

IMS Services

The following IMS services are used simply by the application program:

  • Accesperform database records
  • Issuing IMS commands
  • Issuing IMS service calls
  • Checkpoint calls
  • Sync calls
  • Sending or receiving messages from oncollection user terminals

IMS DB – COBOL BASICS

We include DL/I calls inside COBOL application program to communicate with IMS database. We use the following DL/I statements in COBOL program to access the database:

  • Enattempt out Statement
  • Goback Statement
  • Call Statement

Enattempt out Statement

It is used to pbum the control from the DL/I to the COBOL program. Here is the syntax of the enattempt out statement:

ENTRY 'DLITCBL' USING pcb-name1
                     [pcb-name2]

The above statement is coded in the Procedure Division of a COBOL program. Let us go into the details of the enattempt out statement in COBOL program:

  • The batch preliminaryization module triggers the application program and is executed under it is control.

  • The DL/I loads the required control blocks and modules and the application program, and control is given to the application program.

  • DLITCBL stands for DL/I to COBOL. The enattempt out statement is used to degreat the enattempt out point in the program.

  • When we call a sub-program in COBOL, it is adoutfit is furthermore provided. Likewise, when the DL/I gives the control to the application program, it furthermore provides the adoutfit of every PCB degreatd in the program's PSB.

  • All the PCBs used in the application program must become degreatd inside the Linkage Section of the COBOL program becomecause PCB resides awayside the application program.

  • The PCB definition inside the Linkage Section is calbrought as PCB Mask.

  • The relation becometween PCB masks and consider behaveionual PCBs in storage is produced simply by listing the PCBs in the enattempt out statement. The sequence of listing in the enattempt out statement ought to become same as they appear in the PSBGEN.

Goback Statement

It is used to pbum the control back to the IMS control program. Following is the syntax of the Goback statement:

GOBACK

Listed becomelow are the fundamental points to note abaway the Goback statement:

  • GOBACK is coded at the end of the application program. It returns the control to DL/I from the program.

  • We ought to not use STOP RUN as it returns the control to the operating system. If we use STOP RUN, the DL/I never gets a chance to perform it is terminating functions. Tmind put on is why, in DL/I application programs, Goback statement is used.

  • Before issuing a Goback statement, all the non-DL/I datasets used in the COBOL application program must become shutd, otherwise the program will terminate abnormally.

Call Statement

Call statement is used to request for DL/I services such as executing specific operations on the IMS database. Here is the syntax of the call statement:

CALL 'CBLTDLI' USING DLI Function Code
                        PCB Mask
                        Segment I/O Area
                        [Segment Search Arguments]

The syntax above shows parameters which you can use with the call statement. We will talk about every of all of them in the following table:

S. No. Parameters with Description
1

DLI Function Code

Identifies the DL/I function to become performed. This argument is the name of the four charconsider behaveioner fields tmind put on describecome the I/O operation.

2

PCB Mask

The PCB definition inside the Linkage Section is calbrought as PCB Mask. They are used in the enattempt out statement. No SELECT, ASSIGN, OPEN, or CLOSE statements are required.

3

Segment I/O Area

Name of an inplace/awayplace work area. This is an area of the application program into which the DL/I places a requested segment.

4

Segment Search Arguments

These are optional parameters depending on the kind of the call issued. They are used to oceanrch data segments inside the IMS database.

Given becomelow are the points to note abaway the Call statement:

  • CBLTDLI stands for COBOL to DL/I. It is the name of an interface module tmind put on is link edited with your program’s object module.

  • After every DL/I call, the DLI stores a status code in the PCB. The program can use this particular particular code to figure out whether the call succeeded or faibrought.

Example

For more understanding of COBOL, you can go through our COBOL tutorial here. The following example shows the structure of a COBOL program tmind put on uses IMS database and DL/I calls. We will talk about in detail every of the parameters used in the example in the upcoming chapters.

IDENTIFICATION DIVISION.
PROGRAM-ID. TEST1.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 DLI-FUNCTIONS.
   05 DLI-GU        PIC X(4)    VALUE 'GU  '.
   05 DLI-GHU       PIC X(4)    VALUE 'GHU '.
   05 DLI-GN        PIC X(4)    VALUE 'GN  '.
   05 DLI-GHN       PIC X(4)    VALUE 'GHN '.
   05 DLI-GNP       PIC X(4)    VALUE 'GNP '.
   05 DLI-GHNP      PIC X(4)    VALUE 'GHNP'.
   05 DLI-ISRT      PIC X(4)    VALUE 'ISRT'.
   05 DLI-DLET      PIC X(4)    VALUE 'DLET'.
   05 DLI-REPL      PIC X(4)    VALUE 'REPL'.
   05 DLI-CHKP      PIC X(4)    VALUE 'CHKP'.
   05 DLI-XRST      PIC X(4)    VALUE 'XRST'.
   05 DLI-PCB       PIC X(4)    VALUE 'PCB '.
01  SEGMENT-I-O-AREA        PIC X(150).
LINKAGE SECTION.
01  STUDENT-PCB-MASK.
   05 STD-DBD-NAME              PIC X(8).
   05 STD-SEGMENT-LEVEL         PIC XX.
   05 STD-STATUS-CODE           PIC XX.
   05 STD-PROC-OPTIONS          PIC X(4).
   05 FILLER                    PIC S9(5) COMP.
   05 STD-SEGMENT-NAME          PIC X(8).
   05 STD-KEY-LENGTH            PIC S9(5) COMP.
   05 STD-NUMB-SENS-SEGS        PIC S9(5) COMP.
   05 STD-KEY                   PIC X(11).
PROCEDURE DIVISION.
ENTRY 'DLITCBL' USING STUDENT-PCB-MASK.
A000-READ-PARA.
110-GET-INVENTORY-SEGMENT.
   CALL ‘CBLTDLI’ USING DLI-GN
                  STUDENT-PCB-MASK
                  SEGMENT-I-O-AREA.
GOBACK.

IMS DB – DL/I FUNCTIONS

DL/I function is the 1st parameter tmind put on is used in a DL/I call. This function tells which operation is going to become performed on the IMS database simply by the IMS DL/I call. The syntax of DL/I function is as follows:

01 DLI-FUNCTIONS.
   05 DLI-GU        PIC X(4)    VALUE 'GU  '.
   05 DLI-GHU       PIC X(4)    VALUE 'GHU '.
   05 DLI-GN        PIC X(4)    VALUE 'GN  '.
   05 DLI-GHN       PIC X(4)    VALUE 'GHN '.
   05 DLI-GNP       PIC X(4)    VALUE 'GNP '.
   05 DLI-GHNP      PIC X(4)    VALUE 'GHNP'.
   05 DLI-ISRT      PIC X(4)    VALUE 'ISRT'.
   05 DLI-DLET      PIC X(4)    VALUE 'DLET'.
   05 DLI-REPL      PIC X(4)    VALUE 'REPL'.
   05 DLI-CHKP      PIC X(4)    VALUE 'CHKP'.
   05 DLI-XRST      PIC X(4)    VALUE 'XRST'.
   05 DLI-PCB       PIC X(4)    VALUE 'PCB '.

This syntax represents the following key points:

  • For this particular particular parameter, we can provide any kind of four-charconsider behaveioner name as a storage field to store the function code.

  • DL/I function parameter is coded in the worcalifornia california king storage section of the COBOL program.

  • For specifying the DL/I function, the programmer needs to code one of the 05 level data names such as DLI-GU in a DL/I call, since COBOL does not enable to code literals on a CALL statement.

  • DL/I functions are divided into 3 categories: Get, Update, and Other functions. Let us talk about every of all of them in detail.

Get Functions

Get functions are similar to the read operation supinterfaceed simply by any kind of programming language. Get function is used to fetch segments from an IMS DL/I database. The following Get functions are used in IMS DB:

  • Get Unique
  • Get Next
  • Get Next wislim Parent
  • Get Hold Unique
  • Get Hold Next
  • Get Hold Next wislim Parent

Let us consider the following IMS database structure to understand the DL/I function calls:

IMS Database1

Get Unique

'GU' code is used for the Get Unique function. It works similar to the random read statement in COBOL. It is used to fetch a particular segment occurrence based on the field values. The field values can become provided uperform segment oceanrch arguments. The syntax of a GU call is as follows:

CALL 'CBLTDLI' USING DLI-GU
                     PCB Mask
                     Segment I/O Area
                     [Segment Search Arguments]

If you execute the above call statement simply by providing appropriate values for all parameters in the COBOL program, you can retrieve the segment in the segment I/O area from the database. In the above example, if you provide the field values of Library, Magazines, and Health, then you get the desired occurrence of the Health segment.

Get Next

'GN' code is used for the Get Next function. It works similar to the read next statement in COBOL. It is used to fetch segment occurrences in a sequence. The predegreatd pattern for accesperform data segment occurrences is down the hierarchy, then left to correct. The syntax of a GN call is as follows:

CALL 'CBLTDLI' USING DLI-GN
                     PCB Mask
                     Segment I/O Area
                     [Segment Search Arguments]

If you execute the above call statement simply by providing appropriate values for all parameters in the COBOL program, you can retrieve the segment occurrence in the segment I/O area from the database in a sequential order. In the above example, it starts with accesperform the Library segment, then Books segment, and so on. We perform the GN call again and again, until we revery the segment occurrence we want.

Get Next wislim Parent

'GNP' code is used for Get Next wislim Parent. This function is used to retrieve segment occurrences in sequence subordinate to an established parent segment. The syntax of a GNP call is as follows:

CALL 'CBLTDLI' USING DLI-GNP
                     PCB Mask
                     Segment I/O Area
                     [Segment Search Arguments]

Get Hold Unique

'GHU' code is used for Get Hold Unique. Hold function specifies tmind put on we are going to update the segment after retrieval. The Get Hold Unique function corresponds to the Get Unique call. Given becomelow is the syntax of a GHU call:

CALL 'CBLTDLI' USING DLI-GHU
                     PCB Mask
                     Segment I/O Area
                     [Segment Search Arguments]

Get Hold Next

'GHN' code is used for Get Hold Next. Hold function specifies tmind put on we are going to update the segment after retrieval. The Get Hold Next function corresponds to the Get Next call. Given becomelow is the syntax of a GHN call:

CALL 'CBLTDLI' USING DLI-GHN
                     PCB Mask
                     Segment I/O Area
                     [Segment Search Arguments]

Get Hold Next wislim Parent

'GHNP' code is used for Get Hold Next wislim Parent. Hold function specifies tmind put on we are going to update the segment after retrieval. The Get Hold Next wislim Parent function corresponds to the Get Next wislim Parent call. Given becomelow is the syntax of a GHNP call:

CALL 'CBLTDLI' USING DLI-GHNP
                     PCB Mask
                     Segment I/O Area
                     [Segment Search Arguments]

Update Functions

Update functions are similar to re-write or insert operations in any kind of other programming language. Update functions are used to update segments in an IMS DL/I database. Before uperform the update function, correct now generally there must become a successful call with Hold clause for the segment occurrence. The following Update functions are used in IMS DB:

  • Insert
  • Deenablee
  • Replace

Insert

'ISRT' code is used for the Insert function. The ISRT function is used to add a new segment to the database. It is used to alter an existing database or load a new database. Given becomelow is the syntax of an ISRT call:

CALL 'CBLTDLI' USING DLI-ISRT
                     PCB Mask
                     Segment I/O Area
                     [Segment Search Arguments]

Deenablee

'DLET' code is used for the Deenablee function. It is used to remove a segment from an IMS DL/I database. Given becomelow is the syntax of a DLET call:

CALL 'CBLTDLI' USING DLI-DLET
                     PCB Mask
                     Segment I/O Area
                     [Segment Search Arguments]

Replace

'REPL' code is used for Get Hold Next wislim Parent. The Replace function is used to replace a segment in the IMS DL/I database. Given becomelow is the syntax of an REPL call:

CALL 'CBLTDLI' USING DLI-REPL
                     PCB Mask
                     Segment I/O Area
                     [Segment Search Arguments]

Other Functions

The following other functions are used in IMS DL/I calls:

  • Checkpoint
  • Restart
  • PCB

Checkpoint

'CHKP' code is used for the Checkpoint function. It is used in the recovery features of IMS. Given becomelow is the syntax of a CHKP call:

CALL 'CBLTDLI' USING DLI-CHKP
                     PCB Mask
                     Segment I/O Area
                     [Segment Search Arguments]

Restart

'XRST' code is used for the Restart function. It is used in the restart features of IMS. Given becomelow is the syntax of an XRST call:

CALL 'CBLTDLI' USING DLI-XRST
                     PCB Mask
                     Segment I/O Area
                     [Segment Search Arguments]

PCB

PCB function is used in CICS programs in the IMS DL/I database. Given becomelow is the syntax of a PCB call:

CALL 'CBLTDLI' USING DLI-PCB
                     PCB Mask
                     Segment I/O Area
                     [Segment Search Arguments]

You can find more details abaway these functions in the recovery chapter.

IMS DB – PCB MASK

PCB stands for Program Communication Block. PCB Mask is the 2nd parameter used in the DL/I call. It is declared in the linkage section. Given becomelow is the syntax of a PCB Mask:

01 PCB-NAME.
   05 DBD-NAME         PIC X(8).
   05 SEG-LEVEL        PIC XX.
   05 STATUS-CODE      PIC XX.
   05 PROC-OPTIONS     PIC X(4).
   05 RESERVED-DLI     PIC S9(5).
   05 SEG-NAME         PIC X(8).
   05 LENGTH-FB-KEY    PIC S9(5).
   05 NUMB-SENS-SEGS   PIC S9(5).
   05 KEY-FB-AREA      PIC X(n).

Here are the key points to note:

  • For every database, the DL/I maintains an area of storage tmind put on is understandn as the program communication block. It stores the information abaway the database tmind put on are accessed inside the application programs.

  • The ENTRY statement produces a interconnection becometween the PCB masks in the Linkage Section and the PCBs wislim the program’s PSB. The PCB masks used in a DL/I call tells which database to use for operation.

  • You can bumume this particular particular is similar to specifying a file name in a COBOL READ statement or a record name in a COBOL write statement. No SELECT, ASSIGN, OPEN, or CLOSE statements are required.

  • After every DL/I call, the DL/I stores a status code in the PCB and the program can use tmind put on code to figure out whether the call succeeded or faibrought.

PCB Name

Points to note:

  • PCB Name is the name of the area which refers to the entire structure of the PCB fields.

  • PCB Name is used in program statements.

  • PCB Name is not a field in the PCB.

DBD Name

Points to note:

  • DBD name contains the charconsider behaveioner data. It is eight simply bytes long.

  • The 1st field in the PCB is the name of the database becomeing processed and it provides the DBD name from the library of database descriptions bumociated with a particular database.

Segment Level

Points to note:

  • Segment level is understandn as Segment Hierarchy Level Indicator. It contains charconsider behaveioner data and is 2 simply bytes long.

  • A segment level field stores the level of the segment tmind put on was processed. When a segment is retrieved successcomppermitey, the level numbecomer of the retrieved segment is stored here.

  • A segment level field never has a value greater than 15 becomecause tmind put on is the maximum numbecomer of levels permitted in a DL/I database.

Status Code

Points to note:

  • Status code field contains 2 simply bytes of charconsider behaveioner data.

  • Status code contains the DL/I status code.

  • Spaces are moved to the status code field when DL/I compenablees the procesperform of calls successcomppermitey.

  • Non-space values indicate tmind put on the call was not successful.

  • Status code GB indicates end-of-file and status code GE indicates tmind put on the requested segment is not found.

Proc Options

Points to note:

  • Proc options are understandn as procesperform options which contain four-charconsider behaveioner data fields.

  • A Procesperform Option field indicates exconsider behaveionly wmind put on kind of procesperform the program is authorised to do on the database.

Reserved DL/I

Points to note:

  • Reserved DL/I is understandn as the reserved area of the IMS. It stores four simply bytes binary data.

  • IMS uses this particular particular area for it is own internal linkage related to an application program.

Segment Name

Points to note:

  • SEG Name is understandn as segment name feedback area. It contains 8 simply bytes of charconsider behaveioner data.

  • The name of the segment is stored in this particular particular field after every DL/I call.

Length FB Key

Points to note:

  • Length FB key is understandn as the duration of the key feedback area. It stores four simply bytes of binary data.

  • This field is used to reinterface the duration of the concatenated key of the lowest level segment processed during the previous call.

  • It is used with the key feedback area.

Numbecomer of Sensit down downivity Segments

Points to note:

  • Numbecomer of sensit down downivity segments store four simply bytes binary data.

  • It degreats to which level an application program is sensit down downive. It represents a count of numbecomer of segments in the logical data structure.

Key Feedback Area

Points to note:

  • Key feedback area varies in duration from one PCB to an additional.

  • It contains the longest achievable concatenated key tmind put on can become used with the program’s watch of the database.

  • After a database operation, DL/I returns the concatenated key of the lowest level segment processed in this particular particular field, and it returns the duration of the key in the key duration feedback area.

IMS DB – SSA

SSA stands for Segment Search Arguments. SSA is used to identify the segment occurrence becomeing accessed. It is an optional parameter. We can include any kind of numbecomer of SSAs depending on the requirement. There are 2 kinds of SSAs:

  • Unqualified SSA
  • Qualified SSA

Unqualified SSA

An unqualified SSA provides the name of the segment becomeing used inside the call. Given becomelow is the syntax of an unqualified SSA:

01 UNQUALIFIED-SSA.
   05  SEGMENT-NAME  PIC X(8).
   05  FILLER        PIC X     VALUE SPACE.

The key points of unqualified SSA are as follows:

  • A easy unqualified SSA is 9 simply bytes long.

  • The 1st 8 simply bytes hold the segment name which is becomeing used for procesperform.

  • The last simply byte always contains space.

  • DL/I uses the last simply byte to figure out the kind of SSA.

  • To access a particular segment, move the name of the segment in the SEGMENT-NAME field.

The following images show the structures of unqualified and qualified SSAs:

SSA

Qualified SSA

A Qualified SSA provides the segment kind with the specific database occurrence of a segment. Given becomelow is the syntax of a Qualified SSA:

01 QUALIFIED-SSA.
   05  SEGMENT-NAME  PIC X(8).
   05  FILLER        PIC X      VALUE '('.
   05  FIELD-NAME    PIC X(8).
   05  REL-OPR       PIC X(2).
   05  SEARCH-VALUE  PIC X(n).
   05  FILLER        PIC X(n+1) VALUE ')'.

The key points of qualified SSA are as follows:

  • The 1st 8 simply bytes of a qualified SSA holds the segment name becomeing used for procesperform.

  • The ninth simply byte is a left parenthesis '('.

  • The next 8 simply bytes starting from the tenth posit down downion specifies the field name which we want to oceanrch.

  • After the field name, in the 18th and 19th posit down downions, we specify 2-charconsider behaveioner relational operator code.

  • Then we specify the field value and in the last simply byte, correct now generally there is a correct parenthesis ')'.

The following table shows the relational operators used in a Qualified SSA.

</=

Relational Operator Symbol Description
EQ = Equal
NE ~= Not equal
GT > Greater than
GE >= Greater than or equal
LT < Less than
LE <= Less than or equal

Command Codes

Command codes are used to enhance the functionality of DL/I calls. Command codes reduce the numbecomer of DL/I calls, macalifornia california king the programs easy. Also, it improves the performance as the numbecomer of calls is reduced. The following image shows how command codes are used in unqualified and qualified SSAs:

unqualified ssa

The key points of command codes are as follows:

  • To use command codes, specify an asterisk in the 9th posit down downion of the SSA as shown in the above image.

  • Command code is coded at the tenth posit down downion.

  • From 10th posit down downion onbattbroughts, DL/I considers all charconsider behaveioners to become command codes until it encounters a space for an unqualified SSA and a left parenthesis for a qualified SSA.

The following table shows the list of command codes used in SSA:

Command Code Description
C Concatenated Key
D Path Call
F First Occurrence
L Last Occurrence
N Path Call Ignore
P Set Parentage
Q Enqueue Segment
U Maintain Posit down downion at this particular particular level
V Maintain Posit down downion at this particular particular and all above levels
Null Command Code

Multiple Qualifications

The fundamental points of multiple qualifications are as follows:

  • Multiple qualifications are required when we need to use 2 or more qualifications or fields for comparison.

  • We use Boolean operators like AND and OR to connect 2 or more qualifications.

  • Multiple qualifications can become used when we want to process a segment based on a range of achievable values for a performle field.

Given becomelow is the syntax of Multiple Qualifications:

01 QUALIFIED-SSA.
   05  SEGMENT-NAME  PIC X(8).
   05  FILLER        PIC X      VALUE '('.
   05  FIELD-NAME1   PIC X(8).
   05  REL-OPR       PIC X(2).
   05  SEARCH-VALUE1 PIC X(m).
   05  MUL-QUAL      PIC X      VALUE '&'.
   05  FIELD-NAME2   PIC X(8).
   05  REL-OPR       PIC X(2).
   05  SEARCH-VALUE2 PIC X(n).
   05  FILLER        PIC X(n+1) VALUE ')'.

MUL-QUAL is a short term for MULtiple QUALIification in which we can provide boolean operators like AND or OR.

IMS DB – DATA RETRIEVAL

The various data retrieval methods used in IMS DL/I calls are as follows:

  • GU Call
  • GN Call
  • Uperform Command Codes
  • Multiple Procesperform

Let us consider the following IMS database structure to understand the data retrieval function calls:

IMS DATABASE1

GU Call

The fundamentals of GU call are as follows:

  • GU call is understandn as Get Unique call. It is used for random procesperform.

  • If an application does not update the database regularly or if the numbecomer of database updates is less, then we use random procesperform.

  • GU call is used to place the pointer at a particular posit down downion for further sequential retrieval.

  • GU calls are independent of the pointer posit down downion established simply by the previous calls.

  • GU call procesperform is based on the unique key fields suppsit downd in the call statement.

  • If we supply a key field tmind put on is not unique, then DL/I returns the 1st segment occurrence of the key field.

CALL 'CBLTDLI' USING DLI-GU
                     PCB-NAME
                     IO-AREA
                     LIBRARY-SSA
                     BOOKS-SSA
                     ENGINEERING-SSA
                     IT-SSA

The above example shows we issue a GU call simply by providing a compenablee set of qualified SSAs. It includes all the key fields starting from the basic level to the segment occurrence tmind put on we want to retrieve.

GU Call Considerations

If we do not provide the compenablee set of qualified SSAs in the call, then DL/I works in the following way:

  • When we use an unqualified SSA in a GU call, DL/I accesses the 1st segment occurrence in the database tmind put on meets the criteria you specify.

  • When we issue a GU call withaway any kind of SSAs, DL/I returns the 1st occurrence of the basic segment in the database.

  • If a few SSAs at intermediate levels are not mentioned in the call, then DL/I uses possibly the established posit down downion or the default value of an unqualified SSA for the segment.

Status Codes

The following table shows the relevant status codes after a GU call:

Status Code Description
Spaces Successful call
GE DL/I could not find a segment tmind put on met the criteria specified in the call

GN Call

The fundamentals of GN call are as follows:

  • GN call is understandn as Get Next call. It is used for easy sequential procesperform.

  • The preliminary posit down downion of the pointer in the database is becomefore the basic segment of the 1st database record.

  • The database pointer posit down downion is becomefore the next segment occurrence in the sequence, after a successful GN call.

  • The GN call starts through the database from the posit down downion established simply by the previous call.

  • If a GN call is unqualified, it returns the next segment occurrence in the database regardless of it is kind, in hierarchical sequence.

  • If a GN call includes SSAs, then DL/I retrieves only segments tmind put on meet the requirements of all specified SSAs.

CALL 'CBLTDLI' USING DLI-GN
                     PCB-NAME
                     IO-AREA
                     BOOKS-SSA

The above example shows we issue a GN call providing the starting posit down downion to read the records sequentially. It fetches the 1st occurrence of the BOOKS segment.

Status Codes

The following table shows the relevant status codes after a GN call:

Status Code Description
Spaces Successful call
GE DL/I could not find a segment tmind put on met the criteria specified in the call.
GA An unqualified GN call moves up one level in the database hierarchy to fetch the segment.
GB End of database is reveryed and segment not found.
GK An unqualified GN call tries to fetch a segment of a particular kind other than the one simply retrieved but stays in the same hierarchical level.

Command Codes

Command codes are used with calls to fetch a segment occurrence. The various command codes used with calls are talk abouted becomelow.

F Command Code

Points to note:

  • When an F command code is specified in a call, the call processes the 1st occurrence of the segment.

  • F command codes can become used when we want to process sequentially and it can become used with GN calls and GNP calls.

  • If we specify an F command code with a GU call, it does not have any kind of significance, as GU calls fetch the 1st segment occurrence simply by default.

L Command Code

Points to note:

  • When an L command code is specified in a call, the call processes the last occurrence of the segment.

  • L command codes can become used when we want to process sequentially and it can become used with GN calls and GNP calls.

D Command Code

Points to note:

  • D command code is used to fetch more than one segment occurrences uperform simply a performle call.

  • Normally DL/I operates on the lowest level segment specified in an SSA, but in many kind of cases, we want data from other levels as well. In those cases, we can use the D command code.

  • D command code produces easy retrieval of the entire route of segments.

C Command Code

Points to note:

  • C command code is used to concatenate keys.

  • Uperform relational operators is a little complex, as we need to specify a field name, a relational operator, and a oceanrch value. Instead, we can use a C command code to provide a concatenated key.

The following example shows the use of C command code:

01 LOCATION-SSA.
   05 FILLER		     PIC X(11) VALUE ‘INLOCSEG*C(‘.
   05 LIBRARY-SSA      PIC X(5).
   05 BOOKS-SSA        PIC X(4).
   05 ENGINEERING-SSA  PIC X(6).
   05 IT-SSA           PIC X(3)
   05 FILLER		     PIC X	VALUE ‘)’.

CALL 'CBLTDLI' USING DLI-GU
                     PCB-NAME
                     IO-AREA
                     LOCATION-SSA

P Command Code

Points to note:

  • When we issue a GU or GN call, the DL/I establishes it is parentage at the lowest level segment tmind put on is retrieved.

  • If we include a P command code, then the DL/I establishes it is parentage at a higher level segment in the hierarchical route.

U Command Code

Points to note:

  • When a U command code is specified in an unqualified SSA in a GN call, the DL/I rerigids the oceanrch for the segment.

  • U command code is ignored if it is used with a qualified SSA.

V Command Code

Points to note:

  • V command code works similar to the U command code, but it rerigids the oceanrch of a segment at a particular level and all levels above the hierarchy.

  • V command code is ignored when used with a qualified SSA.

Q Command Code

Points to note:

  • Q command code is used to enqueue or reserve a segment for exclusive use of your application program.

  • Q command code is used in an interconsider behaveionive environment where an additional program may produce a alter to a segment.

Multiple Procesperform

A program can have multiple posit down downions in the IMS database which is understandn as multiple procesperform. Multiple procesperform can become done in 2 ways:

  • Multiple PCBs
  • Multiple Posit down downioning

Multiple PCBs

Multiple PCBs can become degreatd for a performle database. If correct now generally there are multiple PCBs, then an application program can have various watchs of it. This method for implementing multiple procesperform is withineffective becomecause of the overminds imposed simply by the extra PCBs.

Multiple Posit down downioning

A program can maintain multiple posit down downions in a database uperform a performle PCB. This is achieved simply by maintaining a unique posit down downion for every hierarchical route. Multiple posit down downioning is used to access segments of 2 or more kinds sequentially at the same time.

IMS DB – DATA MANIPULATION

The various data manipulation methods used in IMS DL/I calls are as follows:

  • ISRT Call
  • Get Hold Calls
  • REPL Call
  • DLET Call

Let us consider the following IMS database structure to understand the data manipulation function calls:

IMS DATABASE

ISRT Call

Points to note:

  • ISRT call is understandn as Insert call which is used to add segment occurrences to a database.

  • ISRT calls are used for loading a new database.

  • We issue an ISRT call when a segment description field is loaded with data.

  • An unqualified or qualified SSA must become specified in the call so tmind put on the DL/I understands where to place a segment occurrence.

  • We can use a combination of both unqualified and qualified SSA in the call. A qualified SSA can become specified for all the above levels. Let us consider the following example:

CALL 'CBLTDLI' USING DLI-ISRT
                     PCB-NAME
                     IO-AREA
                     LIBRARY-SSA
                     BOOKS-SSA
                     UNQUALIFIED-ENGINEERING-SSA

The above example shows we are issuing an ISRT call simply by providing a combination of qualified and unqualified SSAs.

When a new segment tmind put on we are inserting has a unique key field, then it is added at the proper posit down downion. If the key field is not unique, then it is added simply by the rules degreatd simply by a database administrator.

When we issue an ISRT call withaway specifying a key field, then the insert rule tells where to place the segments relative to existing twin segments. Given becomelow are the insert rules:

  • First - If the rule is 1st, the new segment is added becomefore any kind of existing twins.

  • Last - If the rule is last, the new segment is added after all existing twins.

  • Here - If the rule is here, it is added at the current posit down downion relative to existing twins, which may become 1st, last, or any kind ofwhere.

Status Codes

The following table shows the relevant status codes after an ISRT call:

Status Code Description
Spaces Successful call
GE Multiple SSAs are used and the DL/I cannot satisfy the call with the specified route.
II Try to add a segment occurrence tmind put on is already present in the database.
LB / LC LD / LE We get these status codes while load procesperform. In many kind of cases, they indicate tmind put on you are not inserting the segments in an exconsider behaveion hierarchical sequence.

Get Hold Call

Points to note:

  • There are 3 kinds of Get Hold call which we specify in a DL/I call:

    • Get Hold Unique (GHU)
    • Get Hold Next (GHN)
    • Get Hold Next wislim Parent (GHNP)
  • Hold function specifies tmind put on we are going to update the segment after retrieval. So becomefore an REPL or DLET call, a successful hold call must become issued telling the DL/I an intent to update the database.

REPL Call

Points to note:

  • After a successful get hold call, we issue an REPL call to update a segment occurrence.

  • We cannot alter the duration of a segment uperform an REPL call.

  • We cannot alter the value of a key field uperform an REPL call.

  • We cannot use a qualified SSA with an REPL call. If we specify a qualified SSA, then the call fails.

CALL 'CBLTDLI' USING DLI-GHU
                     PCB-NAME
                     IO-AREA
                     LIBRARY-SSA
                     BOOKS-SSA
                     ENGINEERING-SSA
                     IT-SSA.
*Move the values which you like to update in IT segment occurrence*
CALL ‘CBLTDLI’ USING DLI-REPL
                     PCB-NAME
                     IO-AREA.

The above example updates the IT segment occurrence uperform an REPL call. First, we issue a GHU call to get the segment occurrence we want to update. Then, we issue an REPL call to update the values of tmind put on segment.

DLET Call

Points to note:

  • DLET call works a lot in the same way as an REPL call does.

  • After a successful get hold call, we issue a DLET call to deenablee a segment occurrence.

  • We cannot use a qualified SSA with a DLET call. If we specify a qualified SSA, then the call fails.

CALL 'CBLTDLI' USING DLI-GHU
                     PCB-NAME
                     IO-AREA
                     LIBRARY-SSA
                     BOOKS-SSA
                     ENGINEERING-SSA
                     IT-SSA.
CALL ‘CBLTDLI’ USING DLI-DLET
                     PCB-NAME
                     IO-AREA.

The above example deenablees the IT segment occurrence uperform a DLET call. First, we issue a GHU call to get the segment occurrence we want to deenablee. Then, we issue a DLET call to update the values of tmind put on segment.

Status Codes

The following table shows the relevant status codes after an REPL or a DLET call:

Status Code Description
Spaces Successful call
AJ Qualified SSA used on REPL or DLET call.
DJ Program issues a replace call withaway an immediately preceding get hold call.
DA Program produces a alter to the segment’s key field becomefore issuing the REPL or DLET call

IMS DB – SECONDARY INDEXING

Secondary Indexing is used when we want to access a database withaway uperform the compenablee concatenated key or when we do not want to use the sequence primary fields.

Index Pointer Segment

DL/I stores the pointer to segments of the indexed database in a separate database. Index pointer segment is the only kind of 2ndary index. It consists of 2 parts:

  • Prefix Element
  • Data Element

Prefix Element

The prefix part of the index pointer segment contains a pointer to the Index Target Segment. Index target segment is the segment tmind put on is accessible uperform the 2ndary index.

Data Element

The data element contains the key value from the segment in the indexed database over which the index is built. This is furthermore understandn as the index source segment.

Here are the key points to note abaway Secondary Indexing:

  • The index source segment and the target source segment need not become the same.

  • When we set up a 2ndary index, it is automatically maintained simply by the DL/I.

  • The DBA degreats many kind of 2ndary indexes as per the multiple access routes. These 2ndary indexes are stored in a separate index database.

  • We ought to not produce more 2ndary indexes, as they impose additional procesperform overmind on the DL/I.

Secondary Keys

Points to note:

  • The field in the index source segment over which the 2ndary index is built is calbrought as the 2ndary key.

  • Any field can become used as a 2ndary key. It need not become the segments sequence field.

  • Secondary keys can become any kind of combination of performle fields wislim the index source segment.

  • Secondary key values do not have to become unique.

Secondary Data Structures

Points to note:

  • When we construct a 2ndary index, the apparent hierarchical structure of the database is furthermore alterd.

  • The index target segment becomecomes the apparent basic segment. As shown in the following image, the Engineering segment becomecomes the basic segment, consider behaveionually if it is not a basic segment.

  • The rearrangement of the database structure caused simply by the 2ndary index is understandn as the 2ndary data structure.

  • Secondary data structures do not produce any kind of alters to the main physical database structure present on the disk. It is simply a way to alter the database structure in front side side of the application program.

2ndary data structure

Independent AND Operator

Points to note:

  • When an AND (* or &) operator is used with 2ndary indexes, it is understandn as a dependent AND operator.

  • An independent AND (#) enables us to specify qualifications tmind put on would become difficult with a dependent AND.

  • This operator can become used only for 2ndary indexes where the index source segment is dependent on the index target segment.

  • We can code an SSA with an independent AND to specify tmind put on an occurrence of the target segment become processed based on the fields in 2 or more dependent source segments.

01 ITEM-SELECTION-SSA.
   05 FILLER           PIC X(8).
   05 FILLER           PIC X(1) VALUE '('.
   05 FILLER           PIC X(10).
   05 SSA-KEY-1        PIC X(8).
   05 FILLER           PIC X   VALUE '#'.
   05 FILLER           PIC X(10).
   05 SSA-KEY-2        PIC X(8).
   05 FILLER           PIC X   VALUE ')'. 

Sparse Sequencing

Points to note:

  • Sparse sequencing is furthermore understandn as Sparse Indexing. We can remove a few of the index source segments from the index uperform sparse sequencing with 2ndary index database.

  • Sparse sequencing is used to improve the performance. When a few occurrences of the index source segment are not used, we can remove tmind put on.

  • DL/I uses a suppression value or a suppression rawayine or both to figure out whether a segment ought to become indexed.

  • If the value of a sequence field in the index source segment go withes a suppression value, then no index relationship is established.

  • The suppression rawayine is a user-composed program tmind put on evaluates the segment and figure outs whether or not it ought to become indexed.

  • When sparse indexing is used, it is functions are handbrought simply by the DL/I. We do not need to produce special provisions for it in the application program.

DBDGEN Requirements

As talk abouted in earsit downr modules, DBDGEN is used to produce a DBD. When we produce 2ndary indexes, 2 databases are involved. A DBA needs to produce 2 DBDs uperform 2 DBDGENs for creating a relationship becometween an indexed database and a 2ndary indexed database.

PSBGEN Requirements

After creating the 2ndary index for a database, the DBA needs to produce the PSBs. PSBGEN for the program specifies the proper procesperform sequence for the database on the PROCSEQ parameter of the PSB macro. For the PROCSEQ parameter, the DBA codes the DBD name for the 2ndary index database.

IMS DB – LOGICAL DATABASE

IMS database has a rule tmind put on every segment kind can have only one parent. This limit is the complexity of the physical database. Many kind of DL/I applications require a complex structure tmind put on enables a segment to have 2 parent segment kinds. To overcome this particular particular limitation, DL/I enables the DBA to implement logical relationships in which a segment can have both physical and logical parents. We can produce additional relationships wislim one physical database. The new data structure after implementing the logical relationship is understandn as the Logical Database.

Logical Relationship

A logical relationship has the following properconnects:

  • A logical relationship is a route becometween 2 segments which are related logically and not physically.

  • Usually a logical relationship is established becometween separate databases. But it is achievable to have a relationship becometween the segments of one particular database.

The following image shows 2 various databases. One is a Student database, and the other is a Library database. We produce a logical relationship becometween the Books Issued segment from the Student database and the Books segment from the Library database.

std and library database

This is how the logical database looks when you produce a logical relationship:

Logical DataBase

Logical Child Segment

Logical kid segment is the basis of a logical relationship. It is a physical data segment but for DL/I, it appears as if it has 2 parents. The Books segment in the above example has 2 parent segments. Issued books segment is the logical parent and Library segment is the physical parent. One logical kid segment occurrence has only one logical parent segment occurrence and one logical parent segment occurrence can have many kind of logical kid segment occurrences.

Logical Twins

Logical twins are the occurrences of a logical kid segment kind tmind put on are all subordinate to a performle occurrence of the logical parent segment kind. DL/I produces the logical kid segment appear similar to an consider behaveionual physical kid segment. This is furthermore understandn as a virtual logical kid segment.

Types of Logical Relationships

A DBA produces logical relationships becometween segments. To implement a logical relationship, the DBA has to specify it in the DBDGENs for the involved physical databases. There are 3 kinds of logical relationships:

  • Unidirectional
  • Bidirectional Virtual
  • Bidirectional Physical

Unidirectional

The logical interconnection goes from the logical kid to the logical parent and it cannot go the other way around.

Bidirectional Virtual

It enables access in both the directions. The logical kid in it is physical structure and the corresponding virtual logical kid can become seen as paired segments.

Bidirectional Physical

The logical kid is a physically stored subordinate to both it is physical and logical parents. To application programs, it appears the same way as a bidirectional virtual logical kid.

Programming Considerations

The programming considerations for uperform a logical database are as follows:

  • DL/I calls to access the database remains same with the logical database too.

  • Program specification block indicates the structure which we use in our calls. In a few cases, we cannot identify tmind put on we are uperform a logical database.

  • Logical relationships add a new dimension to database programming.

  • You must become careful while worcalifornia california king with logical databases, as 2 databases are integrated jointly. If you modify one database, the same modifications must become reflected in the other database.

  • Program specifications ought to indicate exconsider behaveionly wmind put on procesperform is enableed on a database. If a procesperform rule is violated, you get a non-blank status code.

Concatenated Segment

A logical kid segment always becomegins with the compenablee concatenated key of the destination parent. This is understandn as the Destination Parent Concatenated Key (DPCK). You need to always code the DPCK at the start of your segment I/O area for a logical kid. In a logical database, the concatenated segment produces the interconnection becometween segments tmind put on are degreatd in various physical databases. A concatenated segment consists of the following 2 parts:

  • Logical kid segment
  • Destination parent segment

A logical kid segment consists of the following 2 parts:

  • Destination Parent Concatenated Key (DPCK)
  • Logical kid user data

logical kid

When we work with concatenated segments during update, it may become achievable to add or alter the data in both the logical kid and the destination parent with a performle call. This furthermore depends on the rules the DBA specified for the database. For an insert, provide the DPCK in the correct posit down downion. For a replace or deenablee, do not alter the DPCK or the sequence field data in possibly part of the concatenated segment.

IMS DB – RECOVERY

The database administrator needs to plan for the database recovery in case of system failures. Failures can become of many kind of kinds such as application crashes, hardbattlee errors, power failures, etc.

Simple Approach

Some easy approaches to database recovery are as follows:

  • Make periodical backup copies of iminterfaceant datasets so tmind put on all transconsider behaveionions posted against the datasets are retained.

  • If a dataset is damaged because of to a system failure, tmind put on issue is propered simply by restoring the backup copy. Then the accumulated transconsider behaveionions are re-posted to the backup copy to provide all of them up-to-date.

Diunfortunatevantages of Simple Approach

The diunfortunatevantages of easy approach to database recovery are as follows:

  • Re-posting the accumulated transconsider behaveionions consumes a lot of time.

  • All other applications need to wait for execution until the recovery is finished.

  • Database recovery is durationier than file recovery, if logical and 2ndary index relationships are involved.

Abnormal Termination Rawayines

A DL/I program crashes in a way tmind put on is various from the way a standard program crashes becomecause a standard program is executed directly simply by the operating system, while a DL/I program is not. By employing an abnormal termination rawayine, the system interferes so tmind put on recovery can become done after the ABnormal END (ABEND). The abnormal termination rawayine performs the following consider behaveionions:

  • Closes all datasets
  • Cancels all pending jobs in the queue
  • Creates a storage dump to find away the basic cause of ABEND

The limitation of this particular particular rawayine is tmind put on it does not ensure if the data in use is accurate or not.

DL/I Log

When an application program ABENDs, it is essential to revert the alters done simply by the application program, proper the error, and re-run the application program. To do this particular particular, it is required to have the DL/I log. Here are the key points abaway DL/I logging:

  • A DL/I records all the alters made simply by an application program in a file which is understandn as the log file.

  • When the application program alters a segment, it is becomefore image and after images are produced simply by the DL/I.

  • These segment images can become used to restore the segments, in case the application program crashes.

  • DL/I uses a technique calbrought write-amind logging to record database alters. With write-amind logging, a database alter is composed to the log dataset becomefore it is composed to the consider behaveionual dataset.

  • As the log is always amind of the database, the recovery utiliconnects can figure out the status of any kind of database alter.

  • When the program executes a call to alter a database segment, the DL/I gets care of it is logging part.

Recovery – Forbattbrought and Backbattbrought

The 2 approaches of database recovery are:

  • Forbattbrought Recovery - DL/I uses the log file to store the alter data. The accumulated transconsider behaveionions are re-posted uperform this particular particular log file.

  • Backbattbrought Recovery – Backbattbrought recovery is furthermore understandn as backaway recovery. The log records for the program are read backbattbroughts and their particular own effects are reversed in the database. When the backaway is compenablee, the databases are in the same state as they were in becomefore the failure, bumuming tmind put on no an additional application program altered the database in the meantime.

Checkpoint

A checkpoint is a stage where the database alters done simply by the application program are considered compenablee and accurate. Listed becomelow are the points to note abaway a checkpoint:

  • Database alters made becomefore the many kind of recent checkpoint are not reversed simply by backbattbrought recovery.

  • Database alters logged after the many kind of recent checkpoint are not appsit downd to an image copy of the database during forbattbrought recovery.

  • Uperform checkpoint method, the database is restored to it is condition at the many kind of recent checkpoint when the recovery process compenablees.

  • The default for batch programs is tmind put on the checkpoint is the becomeginning of the program.

  • A checkpoint can become established uperform a checkpoint call (CHKP).

  • A checkpoint call causes a checkpoint record to become composed on the DL/I log.

Shown becomelow is the syntax of a CHKP call:

CALL 'CBLTDLI' USING DLI-CHKP
                     PCB-NAME
                     CHECKPOINT-ID

There are 2 checkpoint methods:

  • Basic Checkpointing – It enables the programmer to issue checkpoint calls tmind put on the DL/I recovery utiliconnects use during recovery procesperform.

  • Symbolic Checkpointing – It is an advanced form of checkpointing tmind put on is used in combination with the extended restart facility. Symbolic checkpointing and extended restart jointly enable the application programmer code the programs so tmind put on they can resume procesperform at the point simply after the checkpoint.

SHARE
Previous articleCICS
Next articleTrampolining

NO COMMENTS

LEAVE A REPLY