GHU


Known as Get Hold Unique. The Get Hold Unique (GHU) is the hold form for a GU call. Used to retrieve a specific segment in the database. And also used to hold the segment for possible update.

The only difference between GU and GHU is holding a record for update. When issuing GU calls, database position does not matter after retrieval and IMS will calculate the location of the segment to find it.

Before the application program can delete or replace a segment, it must retrieve the segment with holding option to indicate to IMS that it is going to change the segment. Get call with a "hold" is required before every delete or replace performing on the segment.

Once application program successfully retrieved the segment with a Get Hold call, it can delete the segment or change one or more fields (except the key field) in the segment. The another difference between Get Unique call and get HOLD unique calls is Get HOLD call followed by a REPL or DLET call.

The hold status on the retrieved segment is canceled when the DLET or REPL call issued. Application program needs to reissue the hold call if DELT or REPL call required to be issued again.

After issuing a Get Hold call, application program can issue more than one REPL or DLET calls to the segment if application program do not issue any intermediate calls to the same PCB.

If segment not required to be changed after the successful retrieval with HOLD option, application program can proceed with further processing without releasing a lock.

The segment gets released as soon as the current position changes i.e. application program issues another call to the same PCB. However, Get Hold call does not require application program to replace or delete the segment.

CALL   ‘CBLTDLI’ USING GHU
					 	db pcb/aib
						i/o area
						ssa/rsa

DB PCB


  • Database Program Control Block
  • Specifies the DB PCB for the GHU call.
  • DB PCB will act as an input and output parameter.

AIB


  • Known as Application Interface Block.
  • Specifies the AIB for the call.
  • AIB parameter is an input and output parameter.
  • If AIB using in the GHU call, all the below fields must be initialized in the AIB - AIBID, AIBLEN, AIBRSNM1, AIBOALEN.

I/O AREA:


  • Known as Input-Output Area.
  • Specifies the I/O area in GHU Call.
  • I/O Area parameter is an output parameter.
  • If Replace calls completed successfully, IMS returns the requested segment in I/O area.
  • If any path calls issued from the application program, the I/O area must be long enough to hold the longest path of concatenated segments.
  • I/O area always contains left-justified segment data.
  • The I/O area points to the first byte of this area.

SSA:


  • Known as Segment Search Arguments.
  • Specifies to be used in the call.
  • SSA parameter is an input parameter.
  • The SSA supplies in the call to data areas in the application program where the SSA has been defined for the call.
  • Up to 15 SSAs can be used in the parameter.
  • SSA parameter is optional for the GHU call.

RSA:


  • Specifies the area in application program where the RSA for the record should be returned.
  • RSA output parameter is used for GSAM only.
  • RSA parameter is optional for GHU call.