IMS DB Realtime (Scenario based) Interview Questions (51 - 57)
51. How to cancel HOLD status after GHU if no modification is needed?
Issue a GU (Get Unique) or GN (Get Next) call without updating the segment. These calls release the hold without making changes. Avoid REPL or DLET if you don’t want to modify.
52. How do you update the sequence key?
- GHU the segment (hold it).
- DLET (delete) the segment.
- ISRT (insert) it again with the new key value.
IMS does not allow direct updates to sequence keys.
53. Can you use path calls with ISRT/REPL/DLET?
No. Path calls (e.g., GET PATH) are read-only and work only with retrieval calls (GU, GN). Use regular ISRT/REPL/DLET calls.
54. Do you ever use a qualified SSA with REPL/DLET calls?
Yes. A qualified SSA ensures you target the correct segment for update/delete.
55. Is it possible to have a secondary key/alternate sequence key?
Yes. IMS supports secondary indexes (alternate keys) via:
- DBDGEN: Define with TYPE=X (e.g., FIELD NAME=EMPNAME,TYPE=X).
- PSBGEN: Include the secondary index in the PCB.
56. If retrieving data using a secondary index, do you need PSB changes?
Yes. The PSB must include the secondary index PCB.
Steps:
- Define the index in DBDGEN.
- Add the index PCB in PSBGEN (PROCOPT=G for read access).
57. How to access a DB using both primary and alternate keys?
Use two PCBs in your program:
- PCB1: For primary key access.
- PCB2: For secondary index access.