Replace rules summary

The tables below summarize the replace rules.

Specifying the replace rule as P, on any segment in a logical relationship, prevents replacing that segment except when it is retrieved using its physical path. When the replace rule for the logical parent is specified as L, IMS returns a blank status code without replacing any data when the logical parent is accessed concatenated with the logical child. Because the logical child has been accessed by its physical path, its replace rule can be any of the three. So, using the replace rule allows the selective replacement of the logical child half of the concatenation and a blank status code. Specifying a replace rule of V, on any segment of a logical relationship, allows replacing that segment by either its physical or logical path.

The tables that follow the figures below show all of the possible combinations of replace rules that can be specified. They show what actions take place for each combination when a call is issued to replace a concatenated segment in a logical database. The tables are based on the databases and logical views shown in the following figures.

Figure 1. Physical databases for replace rules tables
Two databases: Database 1 has root C and child B. Database 2 has root A and child B. Logical relationship between C (LP) and B (LC).
Figure 2. Logical views for replace rules table
Logical View 1 has root A and concatenated child B/C. Logical View 2 has root C and concatenated child B/A.

Replace rules for logical view 1

Table 1. Replace rules for logical view 1
Replace rule specified Segment attempting to replace Status code Data replaced?
B C B C   B C
P P X     Y  
P P   X RX   N
P P X X RX N N
P L X     Y  
P L   X     N
P L X X   Y N
P V X     Y  
P V   X     Y
P V X X   Y Y
L P X     Y  
L P   X RX   N
L P X X RX N N
L L X     Y  
L L   X     N
L L X X   Y N
L V X     Y  
L V   X     Y
L V X X   Y Y
V P X     Y  
V P   X RX   N
V P X X RX N N
V L X     Y  
V L   X     N
V L X X   Y N
V V X     Y  
V V   X     Y
V V X X   Y Y

Replace rules for logical view 2

Table 2. Replace rules for logical view 2
Replace rule specified Segment attempting to replace Status code Data replaced?
B A B A   B A
P P X   RX N  
P P   X RX   N
P P X X RX N N
P L X   RX N  
P L   X     N
P L X X RX N N
P V X   RX N  
P V   X     Y
P V X X RX N N
L P X     N  
L P   X RX   N
L P X X RX N N
L L X     N  
L L   X     N
L L X X   N N
L V X     N  
L V   X     Y
L V X X   N Y
V P X     Y  
V P   X RX   N
V P X X RX N N
V L X     Y  
V L   X     N
V L X X   Y N
V V X     Y  
V V   X     Y
V V X X   Y Y