IMS status code

IMS status DJ: No preceding get hold call

IMS status code DJ means a REPL or DLET call wasn't preceded by a successful get hold call (GHU, GHN or GHNP) on the same PCB. IMS only replaces or deletes a segment the program is holding.

Other names for this code

Also written as status code DJ, IMS DJ, DL/I status DJ, DJ status code, no get hold IMS.

What it means

To change or delete a segment, a program first reads it with a get hold call. That tells IMS which segment the next REPL or DLET applies to. If the last call on the PCB wasn't a successful get hold, IMS has no held segment to act on, so it returns DJ and changes nothing.

Two details catch people. The get hold has to come straight before the update on that same PCB. IMS also accepts a DLET right after a REPL or DLET that followed the hold. A GU, GN or other get call on the PCB in between ends the hold. And the get hold has to succeed. If it came back with GE or another error status, nothing is held, and the REPL or DLET after it gets DJ. GA and GK on a GHN or GHNP are successful, so the segment is held.

Only REPL and DLET return DJ. It's a programming error.

Common causes

  • The program read the segment with GU, GN or GNP instead of GHU, GHN or GHNP.
  • Another call ran on the same PCB between the get hold and the update. A lookup GU to check a related segment is a common culprit. Use a second PCB for lookups.
  • The get hold call failed, often with GE, and the program issued the REPL or DLET without checking the status.
  • A shared update routine is called after a plain get call in one code path and after a get hold in another.
  • The program took a checkpoint or sync point between the get hold and the update. Reissue the get hold after the checkpoint.

How to find the problem

  1. Trace the calls on that PCB in order. The call just before the REPL or DLET must be a GHU, GHN or GHNP that succeeded (or, for a DLET, a REPL that followed one).
  2. Check the status test after the get hold. Make sure the update runs only when the get hold succeeded (blank, or GA or GK after a GHN or GHNP).
  3. Look for helper routines that issue calls on the same PCB, especially lookups made while building the update.
  4. Check for a CHKP or SYNC call between the read and the update.

How to fix it

  • Change the read to its hold form, GHU, GHN or GHNP.
  • Issue the REPL or DLET right after the get hold, with no other call on that PCB in between. Use a separate PCB for other reads.
  • Only update when the get hold succeeded. Blank is success, and so are GA and GK after a GHN or GHNP.
  • After a checkpoint, reissue the get hold before updating.

IBM documentation

IBM documentation: status DJ. Use the documentation for your installed release.

Report a correction to WND Software.

Questions

Can I use GN and then REPL?

No. Use GHN. A plain GN doesn't hold the segment, so the REPL gets DJ.

Why do I get DJ when I did issue a GHU?

Either the GHU didn't return a blank status, or another call ran on the same PCB between the GHU and the REPL. Either one leaves nothing held.

Does DJ change the database?

No. The REPL or DLET is rejected and nothing is updated.