IMS DB DL/I Functions - IMS/DB

What is IMS DB DL/I Functions?

DL/I function is the first parameter that is used in a DL/I call. This function expresses which operation is going to be completed on the IMS database by the IMS DL/I call. The syntax of DL/I function is as follows:

This syntax represents the following key points:

  • For this parameter, we can afford any four-character name as a storage field to store the function code.
  • DL/I function parameter is coded in the working 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 allow to code literals on a CALL statement.
  • DL/I functions are divided into three categories: Get, Update, and Other functions. Let us discuss each of them in detail.

Get Functions

Get functions are similar to the read operation supported by any 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 within Parent
  • Get Hold Unique
  • Get Hold Next
  • Get Hold Next within Parent

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

ims_database

Get Unique

'GU' code is used for the Get Distinctive function. It works alike to the random read statement in COBOL. It is used to fetch a specific section happening based on the field values. The field values can be provided using segment search arguments. The syntax of a GU call is as follows:

in case you execute the above call statement by providing suitable values for all parameters within the COBOL software, you could retrieve the section in the segment I/O region from the database. within the above instance, if you offer the field values of Library, Magazines, and health, you then get the desired occurrence of the health segment.

Get next

'GN' code is used for the Get subsequent characteristic. it works just like the read next statement in COBOL. it is used to fetch segment occurrences in a sequence. The predefined pattern for accessing data segment occurrences is down the hierarchy, then left to right. The syntax of a GN call is as follows:

if you execute the above call statement via imparting appropriate values for all parameters in the COBOL application, you may retrieve the segment occurrence in the segment I/O area from the database in a sequential order. inside the above example, it starts with accessing the Library segment, then Books segment, and so on. We carry out the GN call again and again, until we attain the segment occurrence we need.

Get next within parent

'GNP' code is used for Get next inside 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:

Get Hold Unique

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

Get Hold Next

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

Get Hold Next within Parent

'GHNP' code is used for Get Hold Next within Parent. Hold function specifies that we are going to update the segment after retrieval. The Get Hold Next within Parent function corresponds to the Get Next within Parent call. Given below is the syntax of a GHNP call:

Update Functions

Update functions are related to re-write or insert operations in any other programming language. Update functions are used to update segments in an IMS DL/I database. Formerly using the update function, there must be a effective call with Hold clause for the segment occurrence. The subsequent Update functions are used in IMS DB:

  • Insert
  • Delete
  • 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 change an existing database or load a new database. Given below is the syntax of an ISRT call:

Delete

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

Replace

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

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 below is the syntax of a CHKP call:

Restart

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

PCB

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

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

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

IMS/DB Topics