SSAs with secondary indexes
If your program uses a secondary index, you can use the name of an indexed field in your SSAs. When you do this, IMS goes directly to the secondary index and finds the pointer segment with the value you specify. Then IMS locates the segment that the index segment points to in the primary database and returns the segment to your program.
To use an indexed field name in the SSA, follow these guidelines:
- Define the indexed field, using the XDFLD statement, in the DBD for the primary database during DBD generation.
- Use the name that was given on the XDFLD statement as the field name in the qualification statement.
- Specify the secondary index as the processing sequence during PSB generation. Do this by specifying the name of the secondary index database on the PROCSEQ parameter for a full-function secondary index database or the PROCSEQD parameter for a Fast Path secondary index database on the PCB during PSB generation.
If you modify the XDFLD of the indexed segment (using the REPL
call), you lose
any parentage that you had established before issuing the REPL
call. The key
feedback area is no longer valid after a successful REPL
call.
- In the DBD:
XDFLD NAME=XNAME
- In the PSB:
PROCSEQ=INDEX
for full-function secondary index databases orPROCSEQD=INDEX
for Fast Path secondary index databases- In the program:
GU PATIENTb(XNAMEbbb=bJBBROKEbbb)
A qualified GU/GN segment name with SSA using the primary key field for target=root segment is supported when a primary DEDB database is accessed through its secondary index using a PCB with the PROCSEQD= parameter.
A qualified GU/GN segment name with SSA using the primary key field for target=dependent segment is not supported. An AC status code is returned for the qualified Get call when a primary DEDB database is accessed through its secondary index using a PCB with the PROCSEQD= parameter.