Examples using the delete rules

The following series of figures shows the use of the delete rules for each of the segment types for which the delete rule can be coded (logical and physical parents and their logical children).

Only the rule pertinent to the example is shown in each figure. The explanation accompanying the example applies only to the specific example.

Figure 1. Logical parent, virtual pairing—physical delete rule example
Root: CUSTOMER (PP, RULES=(---)). Child is BORROW (PD, PP, RULES=---). Logical relationship between BORROW (LC) and LOANS (LP, RULES=(-P-)). LOANS has VLC named CUST. BORROW has LC named PAYMENTS.
Figure 2. Logical parent, physical pairing—physical delete rule example: before and after
Before: LOANS (LP) with child CUST/CUSTOMER. After: LOANS with child CUST/CUSTOMER (PD, LD).
Figure 3. Logical parent, physical pairing—physical delete rule example: database calls
GHU 'LOANS'  STATUS='  '
DLET         STATUS='  '

The physical delete rule requires that all logical children be previously physically deleted. Physical dependents of the logical parent are physically deleted.

The DLET status code will be 'DX' if all of the logical children were not previously physically deleted. All logical children are logically deleted. The LD bit is set on in the physical logical child BORROW.

Figure 4. Logical parent, physical pairing—physical delete rule example
Root: CUSTOMER (PP, RULES=(-P-)). Child is BORROW (PD, PP, RULES=---). Logical relationship between BORROW (LC) and LOANS (LP, RULES=(-P-)). LOANS has LC named CUST. BORROW has child PAYMENTS.
Figure 5. Logical Parent, physical pairing—physical delete rule example: before and after
Before: CUSTOMER with child BORROW/LOANS (PD, LD). After: CUSTOMER (PD) with child BORROW/LOANS (PD, LD). BORROW/LOANS has child PAYMENTS (PD).
Figure 6. Logical parent, physical pairing—physical delete rule example: calls and status codes
GHU 'CUSTOMER'  STATUS='  '
DLET               STATUS='  '
The physical delete rule requires that:
  • All logical children be previously physically deleted.
  • Physical children paired to the logical child be previously deleted.

CUSTOMER, the logical parent, has been physically deleted. Both the logical child and its pair had previously been physically deleted. (The PD and LD bits are set on the before figure of the BORROW/LOANS.)

Figure 7. Logical parent, virtual pairing—logical delete rule example
Root: CUSTOMER (PP, RULES=(---)). Child is BORROW (LC, RULES=---). Logical relationship between BORROW (LC) and LOANS (LP, RULES=(-L-)). LOANS has VLC named CUST. BORROW has child PAYMENTS.
Figure 8. Logical parent, virtual pairing—logical delete rule example: before and after
Before: LOANS with child CUST/CUSTOMER. After: LOANS (PD) with child CUST/CUSTOMER (LD).
Figure 9. Logical parent, virtual pairing—logical delete rule example: calls and status codes
GHU 'LOANS'  STATUS='  '
DLET         STATUS='  '

The logical delete rule allows either physical or logical deletion first; neither causes the other. Physical dependents of the logical parent are physically deleted.

The logical parent LOANS remains accessible from its logical children. All logical children are logically deleted. The LD bit is set on in the physical child BORROW.

The processing and results shown in Figure 7 would be the same if the logical parent LOANS delete rule were virtual instead of logical. The example that follows is an additional one to explain the logical delete rule.

Figure 10. Logical parent, physical pairing—logical delete rule example
Root: CUSTOMER (PP, RULES=(-L-)). Child is BORROW (LC, RULES=---). Logical relationship between BORROW (LC) and LOANS (LP, RULES=(-L-)). LOANS has LC named CUST. BORROW has child PAYMENTS.
Figure 11. Logical parent, physical pairing—logical delete rule example: before and after
Before: LOANS with child CUST/CUSTOMER (LD). After: LOANS (PD) with child CUST/CUSTOMER (PD).
Figure 12. Logical parent, physical pairing—logical delete rule example: calls and status codes
GHU 'LOANS'  STATUS='  '
DLET         STATUS='  '

The logical delete rule allows either physical or logical deletion first; neither causes the other. Physical dependents of the logical parent are physically deleted.

The logical parent LOANS remains accessible from its logical children. All physical children are physically deleted. Paired logical children are logically deleted.

The processing and results shown in Figure 10 would be the same if the logical parent LOANS delete rule were virtual instead of logical. An additional example to explain the virtual delete rule follows in the following figure.

Figure 13. Logical parent, virtual pairing—virtual delete rule example
Root: CUSTOMER (PP). Child is BORROW (LC, RULES=(---)). Logical relationship between BORROW (LC) and LOANS (LP, RULES=(-V-)). LOANS has VLC named CUST. BORROW has child PAYMENTS.
Figure 14. Logical parent, virtual pairing—virtual delete rule example: before and after
Before: CUSTOMER with child BORROW/LOANS. After: LOANS (PD) with child CUST/CUSTOMER (PD, LD).
Figure 15. Logical parent, virtual pairing—virtual delete rule example: calls and status codes
GHU 'CUSTOMER'
    'BORROW/LOANS'  STATUS='  '
DLET                STATUS='  '

The virtual delete rule allows explicit and implicit deletion. Explicit deletion is the same as using the logical rule. Implicit deletion causes the logical parent to be physically deleted when the last logical child is physically deleted.

Physical dependents of the logical child are physically deleted. The logical parent is physically deleted. Physical dependents of the logical parent are physically deleted. The LD bit is set on in the physical logical child BORROW.

Figure 16. Logical parent, physical pairing—virtual delete rule example
Root: CUSTOMER (LP, RULES=(-V-)). Child is BORROW (LC, RULES=(---)). Logical relationship between BORROW (LC) and LOANS (LP, RULES=(-V-)). LOANS has child CUST (LC). BORROW has child PAYMENTS.
Figure 17. Logical parent, physical pairing—virtual delete rule example: before and after
Before: CUSTOMER with child BORROW/LOANS (LD). After: LOANS (PD) with child CUST/CUSTOMER (PD, LD).
Figure 18. Logical parent, physical pairing—virtual delete rule example: calls and status
GHU 'CUSTOMER'
    'BORROW/LOANS'  STATUS='  '
DLET                STATUS='  '

The virtual delete rule allows explicit and implicit deletion. Explicit deletion is the same as using the logical rule. Implicit deletion causes the logical parent to be physically deleted when the last logical child is physically and logically deleted.

The logical parent is physically deleted. Any physical dependents of the logical parent are physically deleted.

Note: The CUST segment must be physically deleted before the DLET call is issued. The LD bit is set on in the BORROW segment.
Figure 19. Physical parent, virtual pairing—bidirectional virtual example
Root: CUSTOMER (PP, RULES=(-B-)). Child is BORROW (LC, RULES=(---)). Logical relationship between BORROW (LC) and LOANS (LP, RULES=(---)). LOANS has child CUST (VLC). BORROW has child PAYMENTS.
Figure 20. Physical parent, virtual pairing—bidirectional virtual example: before and after
Before: LOANs with child CUST/CUSTOMER. After: CUSTOMER (PD) with child BORROW/LOANS (PD, LD).
Figure 21. Deleting last logical child deletes physical parent
GHU 'LOANS'
    'CUSTOMER'  STATUS='  '
DLET            STATUS='  '

The bidirectional virtual rule for the physical parent has the same effect as the virtual rule for the logical parent.

When the last logical child is logically deleted, the physical parent is physically deleted. The logical child (as a dependent of the physical parent) is physically deleted. All physical dependents of the physical parent are physically deleted. That is, ACCOUNTS (not shown), BORROW, and PAYMENT are physically deleted.

Figure 22. Logical child, virtual pairing—physical delete rule example
Root: CUSTOMER (PP, RULES=(---)). Child is BORROW (LC, RULES=(-P-)). Logical relationship between BORROW (LC) and LOANS (LP, RULES=(---)). LOANS has child CUST (VLC). BORROW has child PAYMENTS.
Figure 23. Logical child, virtual pairing—physical delete rule example: deleting the logical child
GHU 'LOANS'         STATUS='  '
    'CUST/CUSTOMER'
DLET                STATUS='  '

GHU 'CUSTOMER'      STATUS='  '
    'BORROW/LOANS'  
DLET                STATUS='  '

The physical delete rule requires that the logical child be logically deleted first. The LD bit is now set in the BORROW segment.

The logical child can be physically deleted only after being logically deleted. After the second delete, the LD and PD bits are both set. The physical delete of the logical child also physically deleted the physical dependents of the logical child. The PD bit is set.

Figure 24. Logical child, virtual pairing—physical delete rule example: before and after
Before: LOANS with child CUST/CUSTOMER (LD). After: CUSTOMER has child BORROW/LOANS (PD, LP). BORROW/LOANS has child PAYMENT (PD).
Figure 25. Logical child, virtual pairing—logical delete rule example
Root: CUSTOMER (PP, RULES=(---)). Child is BORROW (LC, RULES=(-L-)). Logical relationship between BORROW (LC) and LOANS (LP, RULES=(---)). LOANS has child CUST (VLC). BORROW has child PAYMENTS.
Figure 26. Logical child, virtual pairing—logical delete rule example: calls and status
GHU 'CUSTOMER   STATUS='  '
    'BORROW/LOANS'
DLET            STATUS='  '

GHU 'LOANS'     STATUS='  '
    'CUST/CUSTOMER'
DLET            STATUS='  '

The logical delete rule allows the logical child to be deleted physically or logically first. Physical dependents of the logical child are physically deleted, but they remain accessible from the logical path that is not logically deleted.

The delete of the virtual logical child sets the LD bit on in the physical logical child BORROW (BORROW is logically deleted).

Figure 27. Logical child, virtual pairing—logical delete rule example: before and after
Before: CUSTOMER with child BORROW/LOANS (PD), which has child PAYMENTS (PD). After: LOANS has child CUST/CUSTOMER (PD, LD).
Figure 28. Logical child, physical pairing—physical or logical delete rule example
Root: CUSTOMER (LP, RULES=(---)). Child is BORROW (LC, RULES=(-P-), RULES=(-L-)). LOANS (LP, RULES=(---)) has child CUST (LC, RULES=(-P-), RULES=(-L-)). BORROW has child PAYMENTS.
Figure 29. Logical child, physical pairing—physical or logical delete rule example: calls and status
GHU 'CUSTOMER   STATUS='  '
    'BORROW/LOANS'
DLET            STATUS='  '

GHU 'LOANS'     STATUS='  '
    'CUST/CUSTOMER'
DLET            STATUS='  '

With the physical or logical delete rule, each logical child must be deleted from its physical path. Physical dependents of the logical child are physically deleted, but they remain accessible from the paired logical child that is not deleted.

Physically deleting BORROW sets the LD bit on in CUST. Physically deleting CUST sets the LC bit on in the BORROW segment.

Figure 30. Logical child, physical pairing—physical or logical delete rule example: before and after
Before: CUSTOMER with child BORROW/LOANS (PD), which has child PAYMENTS (PD). After: LOANS has child CUST/CUSTOMER (PD, LD).
Figure 31. Logical child, virtual pairing—virtual delete rule example
Root: CUSTOMER (PP, RULES=(---)). Child is BORROW (LC, RULES=(-V-)). Logical relationship between BORROW (LC) and LOANS (LP, RULES=(---)). LOANS has child CUST (VLC). BORROW has child PAYMENTS.
Figure 32. Logical child, virtual pairing—virtual delete rule example: calls and status
GHU 'CUSTOMER   STATUS='  '
    'BORROW/LOANS'
DLET            STATUS='  '

GHU 'LOANS'     STATUS='GE'
    'CUST/CUSTOMER'

The virtual delete rule allows the logical child to be deleted physically and logically. Deleting either path deletes both parts. Physical dependents of the logical child are physically deleted.

The previous delete deleted both paths because the delete rule is virtual. Deleting either path deletes both.

Figure 33. Logical child, virtual pairing—virtual delete rule example: before and after
Before: CUSTOMER with child BORROW/LOANS (PD, LD), which has child PAYMENTS. After: LOANS has child CUST/CUSTOMER (PD, LD).
Figure 34. Logical child, physical pairing—virtual delete rule example
Root: CUSTOMER (LP, RULES=(---)). Child is BORROW (LC, RULES=(-V-)). Logical relationship between BORROW (LC) and LOANS (LP, RULES=(---)). LOANS has child CUST (LC, RULES=(-V-)).
Figure 35. Logical child, physical pairing—virtual delete rule example: calls and status
GHU 'CUSTOMER   STATUS='  '
DLET            STATUS='  '

GHU 'LOANS'     STATUS='GE'
    'CUST/CUSTOMER'

With the virtual delete rule, deleting either logical child deletes both paired logical children. (Notice the PD and LD bit is set on in both.) Physical dependents of the logical child are physically deleted.

Physical dependents of the logical child are physically deleted.

Figure 36. Logical child, physical pairing—virtual delete rule example: before and after
Before: CUSTOMER with child BORROW/LOANS (PD, LD), which has child PAYMENTS (PD). After: LOANS has child CUST/CUSTOMER (PD, LD).