Advantages of using multiple positioning
- You might be able to design your program with greater data independence than you would using
single positioning. You can write application programs that use
GNandGNPcalls, andGUandISRTcalls with missing levels in their SSAs, independent of the relative order of the segment types being processed. If you improve your program's performance by changing the relative order of segment types and all of the application programs that access those segment types use multiple positioning, you could make the change without affecting existing application programs. To do this without multiple positioning, the program would have to useGNandGNPcalls, andGUandISRTcalls with incompletely specified SSAs. - Your program can process dependent segment types in parallel (it can switch back and forth
between hierarchic paths without reissuing
GUcalls to reset position) more efficiently than is possible with single positioning. You indicate to IMS the hierarchic path that contains the segments you want in your SSAs in the call. IMS uses the position established in that hierarchic path to satisfy your call. The control blocks that IMS builds for each kind of positioning are the same. Multiple positioning does not require more storage, nor does it have a big impact on performance.
How multiple positioning affects your program
Multiple positioning affects the order and structure of your DL/I calls.
GU and ISRT
GU and
ISRT calls is when you issue these calls with missing SSAs in the hierarchic path.
When you issue a GU or ISRT call that does not contain an SSA for
each level in the hierarchic path, IMS builds the SSA for the
missing levels according to the current position: - If IMS has a position established at the missing level, the qualification IMS uses is derived from that position, as reflected in the DB PCB.
- If no position is established at the missing level, IMS assumes a segment type for that level.
- If IMS moves forward from a position that is established at a higher level, it assumes a segment type for that level.
Because IMS builds the missing qualification based on current position, multiple positioning makes it possible for IMS to complete the qualification independent of current positions that are established for other segment types under the same parent occurrence.
DLET and REPL with multiple positioning
Multiple positioning does not affect DLET or
REPL calls; it only affects the Get Hold calls that precede
them.
Qualified GN and GNP calls
When your program issues a
GN or GNP call, IMS tries to
satisfy the call by moving forward from current position. When you use multiple positioning, more
than one current position exist: IMS maintains a position at
each level in all hierarchic paths, instead of at each level in one hierarchic path.
To satisfy GN and GNP calls with multiple positioning, IMS moves forward from the current position in the path that is
referred to in the SSA.
Mixing qualified and unqualified GN and GNP calls
GNP calls in order to avoid inconsistent results. Mixing qualified and unqualified
SSAs may be valid for parallel processing, but doing so might also decrease the program's data
independence.GN and GNP calls: - When you issue an unqualified
GNor GNP, IMS uses the position that is established by the preceding call to satisfy theGNorGNPcall. For example:Your program issues these calls: DL/I returns these segments: GU A (where AKEY = A1) A1 GN B B11 GN E E11 GN F111 When your program issues the unqualified
GNcall, IMS uses the position that is established by the last call, the call for the E segment, to satisfy the unqualified call. - After you successfully retrieve a segment with an unqualified
GNorGNP, IMS establishes position in only one hierarchic path: the path containing the segment just retrieved. IMS cancels positions in other hierarchic paths. IMS establishes current position on the segment that is retrieved and sets parentage on the parent of the segment that is retrieved. If you issue a qualified call for a segment in a different hierarchic path after issuing an unqualified call, the results are unpredictable. For example:Your program issues these calls: DL/I returns these segments: GU A (where AKEY = A1) A1 GN B B11 GN E E11 GN F111 GN B unpredictable When you issue the unqualified
GNcall, IMS no longer maintains a position in the other hierarchic path, so the results of theGNcall for the B segment are unpredictable. - If you issue an unqualified
GNorGNPcall and IMS has a position established on a segment that the unqualified call might encounter, the results of the call are unpredictable. Also, when you issue an unqualified call and you have established position on the segment that the callshould
retrieve, the results are unpredictable.For example:Your program issues these calls: DL/I returns these segments: GU A (where AKEY = A1) A1 GN E E11 GN D D111 GN B B12 GN B B13 GN E11 (The only position IMS has is the one established by the GNcall.)In this example, IMS has a position established on E11. An unqualified
GNcall moves forward from the position that is established by the previous call. Multiple positions are lost; the only position IMS has is the position that is established by theGNcall.
- To satisfy an unqualified
GNorGNPcall, IMS uses the position established in the last call for that PCB. - If an unqualified
GNorGNPcall is successful, IMS cancels positions in all other hierarchic paths. Position is maintained only within the path of the segment retrieved.
Resetting position with multiple positioning
To reset position, your program issues a GU call for a root segment. If you want
to reset position in the database record you are currently processing, you can issue a
GU call for that root segment, but the GU call cannot be a path
call.
Example: Suppose you have positions established on segments B11 and E11. Your program can issue one of the calls below to reset position on the next database record.
GU AbbbbbbbAKEYbbbb=bA2) Or, if you wanted
to continue processing segments in record A1, you issue this call to cancel all positions in record
A1: GU AbbbbbbbAKEYbbbb=bA1) Issuing this call as a path call does not
cancel position.