---
title: "IMS DB: Quick Tutorial on GU and GHU calls"
description: "How and when to use GU and GHU calls is perfectly needed to write logic in IMS DB programs. Read more."
url: https://srinimf.com/2017/05/06/gu-and-ghu-calls-in-ims-db/
date: 2017-05-06
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2017/05/pexels-photo-4145190.jpeg?fit=1880%2C1255&ssl=1
categories: ["IMS DB"]
tags: ["IMS DB Tips and Tricks"]
type: post
lang: en
---

# IMS DB: Quick Tutorial on GU and GHU calls

Top differences between GU and GHU calls of [IMS DB](https://srinimf.com/2015/05/07/imsdb-application-calls-and-system-service-calls/) explained here for your reference.

Related[5 Reasons Why You need Qualified SSAs in IMS DB DL/I Calls](https://srinimf.com/2016/06/13/qualified-ssas-in-ims-db-dli-calls-5-reasons-why-you-need/)

## GU CALL

**GU CALL**-Used to retrieve a specific segment occurrence independent of the current position within the database Qualified SSAs identifying each hierarchical level are normally provided.

A GET UNIQUE call with missing levels of qualification uses current control block information for missing levels. If none exist, unqualified SSAs are assumed for the missing levels.

**A GET UNIQUE** call always returns the first segment in the database that satisfies the qualification.

**STATUS CODES:**
‘GE’ – Segment not found
‘bb’ – Successful call

## GHU CALL

**Get Hold call–**Replace and Delete Call-Function Code: ‘REPL ‘ and ‘DLET’. Used to replace and delete the specified segment

Related[What is Replace Call (REPL) in IMS DB](https://srinimf.com/2015/04/08/updating-segments-in-imsdb/)

Read With Hold is necessary before you work on with these calls.

GHU, GHN, GHNP.

Advertisements

While replacing, key portion cannot be modified. For delete call do not move anything into segment area.

```
GHU  EMPSEG (EMPNO=123456)
DLET
(here no need to specify qualification)
```

REPL & DLET must be preceded by HOLD call. Otherwise IMS will give you the return code ‘DA’, ‘DJ’.

Other way of using DLET command

```
GHU       EMPSEG(EMPNO=123456)
GHN       PRSEG---*L  => go for last PRSEG
                  *F  =>go for first PRSEG
DLET
```

 * indicates [Command Code](https://srinimf.com/2012/05/07/imsdb-command-code-d-and-proc-option-p/) Follows

 -,-,-Three spaces

**Also Read**

- [IMS DB SSA: List of Top Command Codes](https://srinimf.com/2017/05/05/command-codes-in-ims-db/)DateMay 5, 2017
- [What is Replace Call (REPL) in IMS DB](https://srinimf.com/2015/04/08/updating-segments-in-imsdb/)DateApril 8, 2015
- [Top IMS DB Status codes Asked in Many Interviews](https://srinimf.com/2015/07/12/these-ims-db-ims-dc-error-codes-asked-in-many-mainframe-interviews/)DateJuly 12, 2015

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2017%2F05%2F06%2Fgu-and-ghu-calls-in-ims-db%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2017%2F05%2Fpexels-photo-4145190.jpeg%3Ffit%3D1200%252C801%26ssl%3D1&description=IMS%20DB%3A%20Quick%20Tutorial%20on%20GU%20and%20GHU%20calls)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2017/05/06/gu-and-ghu-calls-in-ims-db/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2017/05/06/gu-and-ghu-calls-in-ims-db/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2017/05/06/gu-and-ghu-calls-in-ims-db/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2017/05/06/gu-and-ghu-calls-in-ims-db/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20IMS%20DB%3A%20Quick%20Tutorial%20on%20GU%20and%20GHU%20calls&body=https%3A%2F%2Fsrinimf.com%2F2017%2F05%2F06%2Fgu-and-ghu-calls-in-ims-db%2F&share=email)
-

### Like this:

Like Loading…
